About the only O2 related codes where it's ok to replace the sensor with no further testing are the 'slow response' codes. These mean that the O2 is generating the expected voltage but it's slow to make crosscounts. Basically crosscounts are what drives the closed loop fuel control scenario. The 'crossing point' is about .45V. So as the voltage is up over .45V, the computer sees it as rich and takes away some injector pulsewidth. Then the O2 should quickly see lean and report under .45V, computer adds pulsewidth, voltage rises again. This goes on all day long, and when the O2 gets lazy there is more time between crosscounts and voila, slow response code.
O2 catalyst monitoring function: The catalyst basically ends up being somewhat of an oxygen storage tank when it's lit off. The signal voltage to the pcm remains fairly steady. When the catalyst becomes chemically dead, or broken apart, the downstream O2 readings mirror the upstream. Rich/lean/rich/lean. The computer recognizes this and throws a cat efficiency code.
Or it's supposed to anyway. As with all things OBD2 it depends on how sensitive the pcm is. I know my 97's catalyst is inactive and the downstream o2 is in poor condition, reading near 1 volt constantly, but I have no codes present.
The other codes- high voltage, low voltage, heater circuit etc could very well be from a bad O2, but they could also be from a wiring fault or driveability concern. It's best to do a couple quick tests depending on the code to verify trouble at the O2 or elsewhere.