Edit: It's should be noted that most Danish cities already have a remote heating infrastructure in place. Aside from the regulatory issues, it's mostly a question of hooking up datacenters and other heat producing industries to that infrastructure. In most places utilising the remote heating isn't voluntary, if it's available where you live, your home has to be connected.
Things like datacenters are slowly replacing coal fired heating plants, because most of those plants where made to generate electricity, but that's now supplied by more and more renewable energy. So cities need to find other sources of heat, to replace the volume no longer coming from the power plants. Where I live that's datacenters, waste incinerators and heavy industry.
As a new thing, remote cooling is now also attempted by using cold water from limepits.
It’s interesting you can also use remote cooling from lime pits.
There's a brochure from the national innovation fund that mentions a town actually covering about half of its heating needs with heat from a data center, though. [3]
Swedish telco Telia also has had similar plans for a data center in Helsinki, Finland, and their website says their "goal is to recover and reuse all the heat produced" [4], but I'm not sure how much weight to give that since proclaiming a goal only costs a few words. It would be nicer if they said what they're actually doing at the moment even if it were much less than "all of it".
[1] https://www.zdnet.com/article/from-deep-underground-data-cen...
[2] https://www.theguardian.com/environment/2010/jul/20/helsinki...
[3] https://www.sitra.fi/en/cases/district-heating-from-data-cen...
[4] https://www.telia.fi/business/telia-helsinki-data-center
https://helsinkismart.fi/case/waste-not-want-not-data-center...