In the nature book, "Cry Wolf" a guy learns to live near a wolf pack, by "marking" his territory, and then staying out of their territory, opting for for telephotography. They were respectful when respected.
The book is "Never Cry Wolf" by Farley Mowat. In the book, the biologist doesn't stay out of the wolves' territory, he invades it and makes his own territory within their former range. But by not taking too much of their space, the wolves become "allow" it.
At any rate, to the OP, it's an interesting question and one that doesn't have a simple, one size fits-all answer. If you consider medium sized terrestrial predators like wolves or coyotes, there are things in the environment their size or larger (like bears and humans) that can inflict harm on them, so they likely learned to generally avoid other larger animals. With the exception of human hunting, there is nothing in grizzly bears' evolutionary history that could cause them harm so, they likely often don't consider humans to be a threat and instead might consider humans a good snack. Of course there are exceptions to size. Wolves hunt elk which are many times larger than they are, but the wolves' sensory systems have evolved to recognize "elk-looking-things" as something to be hunted.
In the ocean, I suspect there is more variance in terms of size and relative risk. In the ocean, many species can approach very large animals safely (think Molas, whale sharks, baleen whales, etc.). So for a medium sized predator (let's say a small reef shark), approaching a large animal in the water does not necessarily represent the threat that a wolf would have approaching a bear.
In North America, approaching wolves, bobcats, foxes is generally not a problem for humans (unless the animals are habituated/rabid). In Africa, on the other hand, I would sure feel a lot more nervous approaching a medium sized predator (like a hyena). Underwater, I would feel way more comfortable around sharks than I would a grizzly bear. With the exception of really large sharks (like great whites) divers are generally larger than the shark's normal prey, don't move or sound like something to be eaten, and so are unlikely to elicit a hunting response.
Also, consider alligators (not sure if you want to classify them as terrestrial or not). They have the ability to be enormously destructive to humans, but nearly every bad encounter results from alligators become habituated to humans through feeding, etc.
So again, I think the answer really is that it just depends on the species, it's evolutionary history, the animal's particular sensory systems, what it normally feeds on, and what threats generally exist to it.