Actually, it's not illegal, just against building code after Hurricane Andrew. Our home before we downsized had just started to be built before Andrew and was finished before the building codes were updated. So, we had a door that opened inward but over half of the homes in our community were built after the codes were updated so had outward opening doors.
Wanna know why? The door jamb on an outward opening door helps to prevent the door being blown in from the hurricane force winds.
Wanna know why most doors were inward opening before? If you had an intruder trying to force their way in, it is easier to push against a door to close it than to try to pull it closed.
During Hurricane Katrina, which hit us before moving into the Gulf of Mexico and then devestating New Orleans, I walked over to our front door to peek out through the peep hole in the door to see what was going on outside. Our door was strongly vibrating. Craig had to go out in the garage and scrounge around for 2x4s and long screws, and get his drill. He ended up putting 3 or 4 of the 2x4s across our door and drilling into the door frame to make sure our front door didn't blow open from the force of the wind.