Most stacked dryers are 3-4 feet off of the floor. Plubing the gas pipe to that area is ok...but as always, check local
Is it OK to stab the pipe through the wall at that height?
Normally yes. In my area we are not allowed to hide any threaded sections in the wall. Must be visible for inspection. Once inspected can be covered.
No flex connector in the wall either.
shouldn't be much of a problem as the gas water heater is nearby.
Make sure the supply pipe can handle both appliances it you tap into the water heater feed.