Is it illegal for landlord to not fix AC?
It depends on where you live and the climate. In our climate, it is a luxury item and if it was provided in working order, like a dishwasher, it is something they should repair.
However, it is not considered an emergency repair. This means, they could take longer to repair it. A good and decent landlord would want to repair it though if they provided it in working order when they moved in. It is not illegal in some states to not repair it.