This map is from 2020, so it isn't entirely up to date, but it shows the legality of so-called conversion therapy around the world. Surprisingly, it was legal to a large degree just about everywhere. It should also be noted that just because it might technically be legal in a country, that doesn't mean that it's common. Still, it's kind of crazy that so many countries had failed to outlaw outright as of a couple of years ago.
Some of the countries that have moved to outlaw conversion therapy since this map was released include Canada, France, New Zealand, and a few other countries. Some U.S. states ban the practice.