Depends on the beach. If it's protected land (national, state or city park), it's illegal. If private land, with permission. Nobody is likely to get upset if you pick up a few pebbles from public land like a National Forest, but not if you bring in a scoop loader.