Every time I hear someone say that they'd love to have a dog but can't because they don't have a backyard, I cringe. Then I get relieved they don't have a dog because they have usually have such an outdated notion about what it takes to care for a dog.
The idea that dogs need a yard comes from a different era, when Moms stayed home all day and the dog hung out in the yard until the kids came home from school. Then all the kids and the dogs would run around the neighborhood getting all the exercise they both needed. Nobody ever thought of giving the dog a walk because he ran around all afternoon.
Then Moms went to work and kids stopped playing outside, so dogs stopped playing outside and people put them in the yard to play. Great in theory, but neither dogs or kids play in their own backyards unless someone is out there playing with them! Even if there are multiple dogs, they need a stimulus.
At some point in the last few decades people figured out that dogs are much happier and less destructive when they get regular exercise. They need long walks and lots of sniffing new smells - every day and since they're no longer allowed to roam the streets on their own, they depend on us to meet this very basic need for them.
While a backyard is nice when you have a dog,it's not a necessity. Dogs don't need backyards, they need walks.