This is actually a great suggestion. If you are a dog person it can bring a lot of joy, amusement and companionship. The thing that sucks though is that they very short lives. My lhasa apso did live to be 17 years, but this is unusual for most other dog breeds.
About loneliness and losing people dear, my brother's friend's dad lost his parents, wife and son all at an unusually early age. I would have no idea how to deal with that.