Can an exhaust leak cause the computer to throw an O2 sensor code?

I would think a leak at the header/midpipe connection could, but I would think that would be the front O2 and the car would be compensating a lot. Was this the front or rear O2 sensor?