It depends on what you mean by “lightning”. Yes, because charge can flow across a vacuum, but No, because you won’t see anything.
Lightning is a sudden electrostatic discharge between regions of differing electric potential. It has been observed on Venus, Jupiter and Saturn, as well as Earth. There is little material to act as a conductor of charge in Space, so traditional lightning is probably rare. Processes similar to lightning have been observed in electro-magnetic fields around black holes and in highly ionised gas and dust clouds called Nebulae.
The visual effect that you see in the sky is a luminescent plasma left in the wake of the charge moving through the atmosphere: no atmosphere, no plasma, no light.