Not true at all. Can happen under the right circumstances in knee or thigh high water. Not flaming...just as a warning to others.
It is true that swimming near a pier heightens the risk of being bitten or attacked by a shark. They’re drawn by the same thing that the fishermen on the pier are, and bait in the water only adds to the effect.
However, you are correct that staying inside the breakers does not mean you’re safe. Check this out: