I had a GSD in an apartment and she didn't care, once I moved to a house and it made no difference except I got lazy and didn't walk her as much cause I had a yard for her to potty in!
As for small dogs in apartments, well I have a MinPin and he has 10 times the energy of my larger dog.
It's a matter of the dog, the owner and how much you want to devote to your dogs needs. Dogs don't care where they live as long as their needs are met. Look at NY, few people live in houses with big yards and many have dogs and they all live happily in a large dense city.