Can changing the air filter in a 2002 Honda CRV cause error code P1166?

Anything is possible but it is unlikely - the error code P1166 is for the primary oxygen sensor.