Cows are very safe for their herders, assuming there are no bulls (and there never are, those require containment). They can get defensive or spooked and then they're very numerous very large animals with hooves and horns, but their herders won't be the target of their aggression even if the herders are very mean. At least not intentionally.
Pigs are extremely dangerous to children in all cases (they will eat body parts with no hesitation and no effort, like carrots).
Goats are incredibly awesome and accept you as part of their pack and defend you from predators. They can also be assholes but playfully. As with cows, female only herds, as males are dangerous.
I've never herded sharks so I'll go with your opinion on those.
I tried to hang out with white tip reef sharks while snorkelling in Fiji at the start of the year. But they aren't very sociable.
I was able to hang out with a group of cuttlefish though. Cuttlefish are weird and cool.