Air filters remove particulates down to some size, varying based on the filter. They do not scrub CO2 or CO, nor do they (generally) remove other things like VOCs - unless they’re really, really expensive filters. Opening a window exchanges all that junk to be roughly equal to the baseline of your environment, which for most people is at least lower CO2 levels.