# Is this an exception to the rule that strong acids/bases always replace weak acids/bases?

According to the $\mathrm{p}K_\mathrm{a}$ table: hydrochloric acid is stronger than sulphuric acid. It has a $\mathrm{p}K_\mathrm{a}$ around $-6.3$ while the $\mathrm{p}K_\mathrm{a}$ of sulfuric acid is around $-3$. The second dissociation in the case of sulfuric acid is not very extensive and doesn't contribute much to its acidity.

\begin{aligned} \ce{H2SO4 + H2O ~&<=>~ H3O+ + HSO4^{−}&&pK_{a}~=~-3}\\ \ce{HSO4- + H2O ~&<=>~ H3O+ + SO4^{−2}&&pK_{a}~=~2}\\ \ce{HCl + H2O ~&<=>~ H3O^+ + Cl^{-}&&pK_{a}~=~$-6.3$}\\ \end{aligned}

Now $\ce{BaSO4}$ reacts with $\ce{HCl}$ to produce very less of $\ce{BaCl2}$ because of the insolubility of $\ce{BaSO4}$.

My teacher told me that in a reaction "Strong acids or bases replace weak acids or bases". This holds good for this reaction as $\ce{HCl}$ is stronger than $\ce{H2SO4}$.

However $\ce{NaCl}$ reacts with $\ce{H2SO4}$ to produce $\ce{Na2SO4}$ and $\ce{HCl}$. In this case $\ce{H2SO4}$ replaced a stronger acid $\ce{HCl}$. How do we account for this?

$$\ce{H2SO4 + 2NaCl <=> 2HCl + Na2SO4 }$$
Here's a youtube video showing the production of hydrochloric acid under laboratory conditions. Notice the $\ce{HCl}$ produced is a gaseous product, and hence there's an imbalance in our equilibrium; $\ce{HCl}$ escapes out as vapors from the solution, lowering $Q_c$ of the reaction thus making the reaction go forward.