If you're talking about microwave ovens, the microwave heats up the water molecules in an egg, creating steam which builds up enough pressure to cause it to explode.
Why do objects like egg explode in oven ?