I can take on a beehive and win, but it's going to end up stinging me (pun totally intended) as well. Even if you forget about the beehive and focus on an animal that can't really fight back (e.g. forest ants), just because I can take it on doesn't mean that I will prefer to do so for no particular reason.
The answer is different based on the animal's size, but in all cases metropolitan areas remain viable.
Dog vs human
If the animals are big but not building-big (i.e. humans are to the animal what a dog is to a human), then metropolitan areas can afford fortifications. It's easier (and better) to build one big wall around a city than it is to build walls around every remote farm. Having to build less walls means you can instead invest in buildin better walls. Also, a few guards can guard many civilians, as opposed to every farmer being their own guard.
Mouse vs human
If the animals are building-big (i.e. humans are to the animal what a mouse is to a human), then the animal still can't simply walk over the metropolitan area like it's nothing. It can walk on the people easily, but not the dense buildings in which the people will obviously go hide. Not that it can't take out a building if it wants to, but you'd need to give it a reason to want to take out a building.
This is where my beehive analogy comes in. Sure, the animal could come into the area and break stuff; but it will take effort, and the little people will at the very least inconvenience or wound it. Is it really worth the effort? Even if the animal is nigh invincible, it's still annoying to having to wade through the metropolitan area as opposed to a nice open field.
If your animal particularly feasts on people (or anything else found in a metropolitan area), then it's going to suffer the drawbacks because survival comes first. If the animal has easier food sources elsewhere, why would it bother with the more cumbersome metropolitan area?
Supposing your building-big animal does want to particularly come into the metropolitan area, then the same "unified defense" argument from before still applies. It's better for the humans to pool their resources and have a subset of people defend all people, rather than separating and requiring everyone to fend for themselves. It's really just a matter of effort versus reward.
Ant vs blue whale
If the animals are true leviathans that wouldn't even register if they stomp on a metropolitan area (i.e. humans are to the animal what an ant is to a blue whale) then it doesn't matter where you live. The animal will or will not trample you regardless of where you live. This is essentially like living your life under the rule of an indifferent temperamental god. All you can do is hope that god doesn't smite you, but you can't actually change it. You get smote, or you don't.
If you can't prevent something from killing you, it's pointless to spend your days worrying about it. True leviathans are so beyond our abilities that it's futile for us to dedicate our lives towards preventing something we can never prevent.
At this point, all that matters is living your life under the assumption you don't get stomped. The argument for living in a metropolitan area would be the same as if these animals did not exist.
Some may argue that it's better to spread out so the odds of the entirety of humanity getting stomped out lessen, but then again the average casualty rate will remain the same. This is where people's opinions will diverge. Some will want to go live remotely, whereas other either actively disagree or are indifferent to it and instead choose the day-to-day benefit of metropolitan life.