On the other hand, there are plenty of noise-related laws preventing you from installing an AC loud enough to be a nuisance for your neighbors. But that's solved by getting one with proper sound isolation, or placing it in such a way that the noise doesn't travel to the neighboring properties.
Similarly, you aren't allowed to install an AC on the facade of a protected historical building. But that can be solved by installing it on the rear of the building (where it is invisible), or by placing the unit itself indoors and using hidden air vents.
There's also the issue of landlords and HoAs banning you from making modifications, but that's not really a matter of legality.