Based on density functional theory calculations, the capability of nickel and iron doped graphene and graphene oxide nanosheets (GNS and GONS) for adsorption of ozone, sulfur dioxide and nitrogen dioxide molecules are scrutinized. The molecular electrostatic potential, adsorption energy and charge transfer of these gas molecules on nickel and iron doped GNS and GONS are reported. The high negative adsorption energy values exhibit that the nickel and iron dopant atoms can remarkably increase the interaction between GNS and GONS and molecules. The range of chemisorption energy is -145.9 to -439.5 kJ/mol for the most stable complexes. The results indicated that the iron doped GNS and GONS are most effective for adsorbing ozone, nitrogen dioxide and sulfur dioxide molecules with obvious charge transfer. After the adsorption of these molecules, the energy gap of the G and GO are increased in all configurations. This investigation shows that GN based nanomaterials can be helpful for controlling and capturing of harmful gases.