Or you can be a stray dog living on the street being just aggressive enough that people don't bother you, but you aren't being killed because you're protected by a treaty for humane treatment of animals and your numbers aren't dwindling fast enough because people aren't spaying their pets and the government doesn't have enough resources to spay every stray. You also learn how to appear cute and harmless when hungry and how to jump on a table, grab a loaf of bread and run at over 30mph uphill.
Such is the nature of pets. Between 30 and 80 people are killed every year by dogs. And yet they aren't outlawed. There is a threshold below which we accept risk.
Unless you have a dog that's trained to attack, generally they're pretty docile with just a treat or two, might be good enough to stop opportunistic crimes though.
Something I learned from our local shelter: rescued street dogs in urban environments tend to be pretty friendly. Non-aggressive dogs get regularly fed by kind hearted people, aggressive dogs don't and have to compete for scraps with other animals.
Stray dogs are a real issue in developing countries like Russia and India. They can be aggressive since they're wild animals.
Even if they're not killed, the strays have fight for survival on their own. Even in developed countries like the US, there are more dogs that need to be adopted than people to adopt them, so many are left in shelters and some are euthanized because the shelters don't have enough resources to care for them.
Stray dogs living in packs would certainly prefer to have regular meals and a shelter and not to be hunted down by people, but they're just fine without humans "owners". It's the humans who have problems with them.
This is exactly why stray dogs shouldn't be allowed to exist. They're a threat to the community. We don't have them at all here in Japan, as far as I can tell; we do have real wild animals, like bears and boars, that sometimes threaten and attack people, but that's normally only in rural places, and those are actual wild animals, not feral pets or invasive species. We also have stray cats, but while one might argue those are a threat to some native animal species like birds, they're certainly not a threat to humans.
In countries with well-managed stray dog populations, people actually feed them, and they get rid of carcasses and other leftovers on the street. Their life might be harsh, but not entirely unpleasant. In countries with unmanaged populations, people will be harsh towards them and mistreat them. And they will also be more aggressive towards humans in return.
Thailand, homeless dogs run around in packs in the streets. The Buddhist culture isn't going to put them down, but with folks actively feeding leftover food to the strays, there's a bit of a problem in almost every city--especially if rabies starts floating around. They'll get into hierarchical scuffles at night leading to a some very short but very loud howling. That said, unlike those with an owner, most would rather avoid you than bark and get needlessly aggressive for you just walking on a public sidewalk.
To torture the analogy further, stray dogs are typically more dangerous than attack dogs - there's nobody (company) holding their leash, and they still have sharp teeth (developed knowledge of a relatively opaque topic).
Also a stick. I'm pretty sure it's legal to carry a stick wherever. Do not attempt against packs of more than 3-4 dogs, a large pack of strays is dangerous. Also, do not hit the dog too hard if it belongs to somebody - it's not polite to break other people's property, no matter how much you want to kill it.
It's trickier if you're on a bike, but then I usually opt to kick them as they chase me. So far, I've outrun the ones that weren't deterred after being kicked.
If you live in a normal country that actually has animal care centres where they humanely kill stray dogs, you probably don't have problems to which the above advice applies.
reply