Yes, but only with a few methods. While only one of these technically evolves Haunter, the rest allow you to find a Gengar.
In Generation 4, when the GTS was still up, there was a glitch that could be performed. This glitch allowed you to evolve trade evolutions without actually trading the Pokemon.
A little more information in my source.
Gengar is in the 5th room from the left on the 2nd floor (I'm pretty sure it's the room with the eyes in the picture) if you have a GBA Pokemon game in the GBA slot. The GBA game must be in the slot when you turn the DS on. As for Gengar itself, it is a very rare random encounter- about a 1 in 25 chance of finding it.
In Yellow, there is a glitch that allows you to get a Gengar. It's a relatively long process, which is noted in my source.
In Sun, Moon, Ultra Sun and Ultra Moon, Gengar can be called as an SOS ally in the abandoned Thrifty Megamart.
In Sword and Shield, Gengar can be found at Giant's Cap, Giant's Mirror, South Lake Miloch, or the Stony Wilderness, the last of which it can only be found in Max Raid battles.
Hope I helped!