Can sodium in the diet cause water retention?

Yes it can . Excess sodium in the diet is a big reason for swelling and water retention in a variety of disease states. Wherever sodium goes, water follows...Its called osmosis.