You can, but it's risky IMO. The waters off our shores are just not as clean as they once were. You would be better off just buying it from your LFS or online.
don't have any data backing me or anything but I asked this question (not sand but picking seaweed and what not off the shore) and someone told me 'think of the shore line like the skimmers of the oceans' you never know what kind of junk washes up.