Why do dogs lick people and other dogs in the face?
Domesticated dogs inherited this trait primarily from wolves, and more specifically, wolf pups. Wolf pups will lick the faces of their mother to try and induce her to vomit some of her last meal. For a weaning pup this is far easier for them to digest and eat than meat and bones right from a carcass.
Part of the selective breeding that went into creating the domesticated dog species thousands of years ago involved breeding of more timid wolves and wolves that exhibited more puppy like behavior. Most adult wolves would have an untenable and difficult relationship with humans so a more fitting companion to a human would be a wolf that is less aggressive and more willing to follow the human pack.
Other wolf puppy behaviors that dogs carried is play. Adult wolves rarely play while wolf pups play consistently as a means of learning.