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?