I had a friend that was not allowed to run air conditioning in his flat. The landlord said the old wiring could not handle it. I said that all you needed was a decent UPS (they make these just for window units in India), but my friend just moved instead. 100+ F is too hot in a flat during Summer.
I used to live in an apartment that also explicitly disallowed window units. The apartment did have a fireplace though, and I figured hot air rises, so we just shoved a window unit in there and let the hot air vent out the chimney.
It did the trick, and we never agreed not to install a fireplace unit.
While I admit I didn’t pursue it when I lived in a similar situation, there’s a case to be made that would violate electrical code. You should be able to safely plug in any appliance which meets the limitation of the outlet.
In my case, I just ignored that and got a window AC anyway. Granted it was a lot smaller than needed and even that made the lights dim, but it did plug in to a standard outlet. Probably not a good choice but the easy choice
The landlord said the old wiring could not handle it.
If wherever it was was dry, you can use an evaporative cooler. They can only cool so much, but they're far more energy efficient than an air conditioner.
You can also get low-end portable air conditioners. These are noisier and not as energy-efficient as a window unit, but you can get pretty small-capacity ones that will run on regular 120V lines, don't need 240V. It'll maybe keep a room cool.