Solid archaeological evidence places domestication of the dog at 12-14,000 years ago. More tenuous archaeological evidence pushes that date back to 30,000 years ago. Some DNA evidence suggests that dogs have been living with us for as long as 100,000 years, i.e. before the advent of modern humans.
Over the millennia we have systematically bred dogs for some of the traits we most admire in ourselves: loyalty, courage, capacity for teamwork, etc. The fallout from all this selective breeding is that the average dog is, in some respects, morally superior to the average human. Those of us who live with dogs intuitively understand this.
Don't get me wrong, I'd save the human. But don't underestimate the strength and depth of the bond between dog and human.