2NaHCO3 + H2SO4 [dil.] ⟶ Na2SO4 + 2H2O + 2CO2 ⟶ H2CO3 (unstable)
Na2CO3 + H2SO4 [dil.] ⟶ Na2SO4 + H2O + CO2 ⟶ H2CO3 (unstable)
Ammonia is evolved when an ammonium salt and alkali are heated because a less volatile base (e.g.,NaOH) displace the more volatile base, NH4OH and we get the products NH3 and H2O.
NH4Cl + NaOH ⟶ NaCl + H2O + NH3