Sure if you have the time to devote to him. I just hope your roommates are up for a pup. You will be taking it out every two hours for a while and there may be crying/whining at night when you sleep.
About the yard, ask your neighbor if their dog is healthy and current on their vaccinations.
My daughter has a dog in her apartment sharing with 2 roommates. One is seldom there and the other has grown to like the dog and now it has two mommies. This has really been helpful for my daughter as her job would get her home at 2am and she did not want to be getting up at 6-7am to take her dog out to pee. Her roommate was gracious enough to take the dog out when she gets home from graveyard shift, just after 7am so my daughter could sleep a bit.
Our dog has some neighborhood dog friends and enjoys greeting them, but I think she does not feel the need for more humans in her "pack". It's mostly my other daughter and myself.