SO2 comes from impurities in petrol, coal power stations, volcanic eruptions and the extraction of some metals such as zinc:
ZnS + O2 => Zn + SO2
SO2 reacts slowly with O2 to form SO3:
2SO2 + O2 <=> 2SO3
SO3 is soluble in water and therefore gets washed out by rain, forming H2SO4:
SO3 + H2O => H2SO4
----
NO and NO2 come from combustion of fossil fuels and lightning strikes - nitrogen needs a high amount of energy to bond with oxygen:
N2 + O2 => 2NO
N2 + 2O2 => 2NO2 - OR - 2NO + O2 => 2NO2
NO2 is soluble in water and so forms HNO3 with rain:
2NO2 + H2O => HNO2 + HNO3
Hope that helped a bit