It depends on the make and model of your car. For most cars, the answer is yes - the check engine light will reset after replacing the O2 sensor, but it can take a while. Every time you start the engine and warm it up, the car checks the emissions. It may take 10-20 successful cycles before the engine control module understands that the oxygen sensor is working and removes the light. So it's definitely easier to clear the error code with a scanner.