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