With a 02 sensor tool, it should come right out. A little wd40/ pb blaster, a little tapping, will unseize those that are stuck. If not, I agree, heat. Either let the exhaust get hot, wont take more than a few minutes. Then just worry about breaking it loose. Let it cool off, then remove it completely.
Depending on location, it can be difficult to stick a torch for those stubborn ones. I have used mini and pencil torches (cheap o's from Harbor Freight). Takes several minutes to heat the sensor, but works fine.