Putting a glass of water in the microwave does work and provides moisture to the foods you're heating.
As the glass of water heats up and gets hot enough it releases steam into the microwave which creates moisture for the food.
You can also heat a glass of water or a cup of water or other beverages in the microwave.
I will sometimes heat a ceramic mug of coffee in the microwave for around 30 seconds to a minute when my coffee gets cold.
I've been heating coffee and even tea in ceramic mugs for several years now without any issues.
I've also always added a glass or cup of water to the microwave when eating things that required moisture so they wouldn't dry out.
The glass of water in the microwave or cup of water in the microwave has always worked for me.
You can also add a damp paper towel wrapped around the food such as bread or pizza etc to keep the food moist and prevent it from drying out.