However you use heat energy to generate other energy, it will not solve the problem of heat being increased in cities. Heat is an end State energy form.
This is why you may have heard the phrase the heat death of the universe. Entropy can be thought of as all energy being converted to heat, evenly distributed in the universe. The best you can do is move the heat elsewhere.
Heat death of the Universe happens when the heat is evenly distributed and there’s no way to move it to produce other forms of energy, like electricity.
Theoretically, heat can be turned into matter per Einstein, but we haven’t figured that out yet.