All it takes to ignite fumes is a little spark. No matter how big or small the spark is, if there are enough flammable fumes in the air, the tiniest spark will light up the sky. Therefore, having AC outlets in an engine compartment with gas engines is a BIG no no. Plugging an item into or pulling an item out of an outlet doesn't cause a spark every time. A spark will only occur if the load you are plugging in/out is turned on.
When an item is turned on it wants to draw power to work. It will draw power as soon as it gets a chance and will keep drawing it until it is completely disconnected from the outlet. As we know, electricity can and will jump through the air to get to where it wants to go. The bigger the power draw the further it can jump. With all of this in mind, the problem isn't with an item that is already plugged in and working, it arises when we plug in or unplug an item. This action can create a spark inside the outlet between the pins of the plug and the contacts of the outlet. If there are enough fumes in the surrounding area, Bang! To get around this, all AC powered items in an engine compartment with gas engines should be hard wired (connected directly to supply cable). This will help avoid any fiery moments. As per normal, a licensed electrician should be consulted.