Dolphins generally aren’t dangerous to humans, even in the wild.
In fact they tend to be more dangerous in captivity.
Killer whales, for instance, the largest and most lethal dolphin in existence, have no recorded incidents of harming or killing humans in the wild. But in captivity they have been known to go insane and kill their handlers.
As always, even “harmless” animals are dangerous if they are ten times bigger than you. Whale sharks for instance are generally harmless to humans, but their sheer size can make them a threat if they inadvertently bump you. Same with cows.
Bottlenose dolphins, which you are probably referring to, fortunately are pretty small and really are generally harmless to humans, though there are incidents of some of them getting horny and wanting to rape scubadivers. While I haven’t actually heard of such a case happening, these dolphins are a pretty horny lot and have been known to be aroused by human women.
Still if you are wearing a chastity belt while snorkeling with them you should probably be safe.