Yep. You’re definitely going to want to avoid the creeping larval migrans from hookworms.
You’re only partially right about beaches being safe though. Hookworms are species specific parasites, meaning only dog hookworms can infest dogs and cat hookworms can only infest cats and so forth and so on. (Yes, there’s a human hookworm, but they’re mostly eradicated in the US now).
Hookworm eggs and larva prefer and thrive in moist sandy soil... like beaches.
What happens when you walk on soil that has hookworm larva in it, is that the larva follow a hair follicle or pore through the skin of your foot and attempt to make it’s way to the small intestine. But, it can only find its way in the right species. No idea why. If you’re the wrong species, it wanders around in your skin leaving these mole-like red tracks in your skin. People who have had it say it’s pretty much torture. There didn’t use to be a treatment. You had to let it run it’s coarse, like chiggars (there’s no digging the little bastards out). I don’t know if there’s one now.
So, that’s why dogs and cats aren’t allowed on beaches. You will get a "talking to" by everyone and the cops called on you if you try to skirt the rules on this. It’s still serious business.
There are some beaches that allow dogs. A lot of them, you have to bring proof your dog is vaccinated and on preventatives. Nonetheless, you definitely want to wear shoes on those beaches or have some kind of barrier between you and the sand.
Overall, people are taking better care of their pets so it’s something that’s fading away into history. You just don’t hear about it as much anymore.
Even so, I would not go barefoot on a beach that allows pets. Environmental conditions haven’t changed to lessen a rise in prevalence and thr whole reason they’re not as common now is that people have had enough disposable income to afford the vet care. As things continue to degrade due to climate change, that will be less true. A lot of thing that used to be a problem will make a come back.