Yes. That is what trees actually do, they clean the air by taking in poor air and replacing it with ckean oxygenated air. Trees are where most of the wirlds oxygen is produced. The problem is that deciduous forests world wide are being destroyed at an astonishing rate while air polution gets worse and more toxic.
Trees have very little effect on pollution. However they do produce some oxygen. Most oxygen is produced by aquatic plants and algae, not trees. Most air pollution is small particles and gasses like SO2 and NO2, which are not absorbed by plants.