The reason why you can't put an egg in the microwave is because it can explode.
Putting a whole egg that is still in the shell in the microwave will cause steam to build up inside the egg and lead to a sudden explosion as the steam has no other way to escape the egg.
When a whole egg is microwaved and explodes it creates a huge mess and can possibly cause harm.
You can cook eggs in the microwave but you must always crack the egg open and place the egg inside a microwave safe dish.
An eggs shell acts like a sealed container and traps the steam as the egg heats up in the microwave and causes high pressure inside the egg.
When the pressure inside the egg gets too high it causes the egg to explode violently and scatters the hot egg contents everywhere.
You could also gently poke a hole in the egg if you want to put the egg in the microwave without cracking it.
The hole or holes in the egg shells will allow the steam to escape.