FYI, in many countries and U.S. states, it's illegal to take sand from a beach.

Cool website though.

(Also, in many U.S. parks, it's illegal to take rocks, sticks, or other natural material.)

That's a tad pedantic. Everyone takes sand from the beach. That's simply the nature of going to a beach. The spirit of those laws is to prevent people from taking large quantities of sand for some personal or commercial purpose.

You may think it is pedantic, but it's not dissimilar to those that think "no cop, no stop" is valid. Just because you didn't get caught doesn't mean it's not violating the regulations.

The spirit of the law is not "large quantities", it's to get people used to the idea of letting nature be and not taking something just because you want to. If you come across a rock that you think is interesting and keep it for yourself, you're denying the next person to discover it on their trip. If you take a rock or two or maybe three, then so does the next person, and the next, well, you get how math works. So since people can't be trusted to not take, there exists an official policy that says you can't.

But is it legal to take a microscope to the beach?

Not that I am aware of. I wouldn't suggest doing that in North Korea though (or possessing any type of scientific or other measuring instrument there).

The website shows pictures of the sand collection and the microscope. It does not appear to be at a beach.