There are many acids, and each one has its own 'strength'. Sulphuric acid is a stronger acid than ethanoic acid. If you have ethanoic acid reaction with NaOH, you will get the salt sodium ethanoate but if you then add sulphuric acid to this salt, the weaker ethanoic acid will be displaced by the stronger sulphuric acid to give sodium sulphate and ethanoic acid back. HCl is stronger than HNO3 which is stronger than HNO3.....etc HCl will be able to displace HNO3 from a nitrate salt, but HNO3 will not be able to displace the stronger HCl from a chloride salt. HCl will displace the weaker carbonic acid from the carbonate as well.
So the reaction of an acid and a salt depends on the strength of the acid and the acidic group present in the salt.