Teslas use the AC and heat to cool or heat the batteries as necessary when charging or discharging. I don't think it's so crazy to cool air you're blowing on the alternator to keep it cool so it doesn't fry when you're, for example, charging a big LiFePo4 bank. Maybe a liquid cooled alternator is in our future.
I haven't thought it all out, but I strongly suspect this would amount to creating energy out of nothing. If you diverted cooler room air over the alternator, or cool sea water through some sort of heat exchanger, then sure, no problem. I can see that you might be able to get more energy out of the cooler alternator than you used to cool it.
But on the other hand, if you take electrical power generated by the alternator (you'd certainly want to assume you weren't using previously stored power to run the AC), used it to power an air conditioner, and then used the output of that AC to cool the alternator, I'm pretty sure you couldn't generate as much extra power from the now cooler alternator as you had to expend to run the AC. If you could, I think you might just have invented a perpetual motion machine, essentially. Free energy from nowhere.
Although on second thought, I may be confusing things if it's not that the cooler alternator produces more energy. Maybe it's just that the voltage regulator adjusts to cause the alternator to produce less energy to avoid physically damaging the alternator.
Similarly, electric cars cool the batteries so that the batteries don't get damaged from the heat. In that case, it only has to do with prolonging battery life. (I have a Bolt and a Volt.)