Can oxygen form ozone when it interacts with lightning?

Yes.