Can a liquid exert pressure sideways ?
Yes, liquids can exert sideways pressure too.
It is important to know that all liquid exerts pressure in all directions except at the surface. The pressure at any point in the liquid is based on the depth of that point. The pressure at the surface is zero because the depth is zero.