We have that in the Netherlands in plenty of cities called “stadsverwarming”. It is hot water pumped around in a closed loop and residences take heat out of it with heat pump. The source is the cooling off industries, power plants, or dedicated heaters.
They currently are efficient but still expensive because of a law that the pricing has to be similar to heating with would have been.