Can air conditioners be driven directly by gasoline engines rather than generators->electrical AC? Perhaps just replacing the electro-compressor with an in-place gas version.
Yes, but it's not really a good idea in this kind of environment.
Generally they'd run 200-500KW diesel generators in a unit generator farm, then run power cabling (3 phase) out to PDUs in clusters of tents, with single-phase runs to standard military ECUs (air conditioners) attached to each tent. They also need electricity INSIDE the tents, for computers, lighting, etc.
Generators are noisy, need to be serviced and fueled, and the small ones (~10KW) that you'd want to run on an HVAC are less efficient (especially for diesel), loud, etc. You also don't want fuel tankage near tents which might be hit by incoming mortars...especially mogas (gasoline) tankage...JP8/Jet-A/diesel is a fair bit less bad.
Over time, they moved to a "prime power" system for the larger bases, with a big farm of 2MW gensets run by a contractor, and an on-base power distribution system, sort of like towns in Alaska, islands, etc.
Using an engine to directly run HVAC is done on reefers (insulated/refrigerated shipping containers), but even those are moving more and more to electrical hookups (so when they're in a big storage area, they can all be connected to cheaper power).
Some of this power was for things like a 20 x 20 grid of 16-man tents, each with HVAC.
I still think the primary consumer of liquid fuels was aviation -- fighters taking off on afterburner, big cargo aircraft transporting tens of tons per load, helicopters, etc.