Concentrated sulfuric acid is a dehydrating agent but it reacts with basic gases like ammonia ($NH_3$) and reducing gases like hydrogen sulfide ($H_2S$). It does not react with carbon dioxide ($CO_2$).