Any non-intrinsically safe electrical appliance can cause an explosion, if operated in an explosive atmosphere. The inside of an Airstream trailer without a gas leak is not an explosive atmosphere.....
But, I expect the warning you are seeing is more to do with exposing the sides of the microwave cabinet to the radiant heat produced by the open flame of an operating burner.
I offer that installing the microwave under the gas cook top is perfectly safe, as the bottom and sides of a commercially available RV gas range are rated for direct contact with the cabinets of the trailer.
Common sense says two feet isn't going to make any real difference if there is a gas leak.
And, for what it is worth, the factory mounts them in the same configuration.
Jeff & Cindy
'09 27FB Flying Cloud
'91 350 LE MH