Dogs are a pack-social species. Unlike solitary species such as bears or herd-social species such as cattle, pack-social animals (such as humans and many other primates) have a hierarchy.
Pack-social creatures have many rituals--some instinctive, some developed by the pack over time, some invented by individuals--for establishing the trust and caring that allows the pack to function effectively as a unit, and for establishing the hierarchy that keeps it running smoothly, especially in a crisis.
Dogs can't talk, they don't have hands, they haven't got a hundred facial muscles for communicating with looks, and even the "keen-eyed" breeds are almost legally blind by human standards. So their rituals are built around the senses they do have: hearing, smell and touch. Bumping into another dog and finding out how he reacts is a good way of expressing camaraderie, while at the same time determining which of you outranks the other.
Dogs and humans form multi-species packs, so we get the same treatment from them, just as we have taught them some of our own species's social rituals.
Dogs and wolves are a single species. Dogs are the descendants of the wolves who were curious and adventurous enough to investigate the advantages of forming a multi-species pack. Their running speed and acute hearing and olfactory senses, combined with our planning ability and sharp sticks that could kill even a mammoth, made it possible for a mixed pack to bring down far more game than either could do alone.
DNA analysis recently discovered that dogs domesticated themselves only once, in what is now China, around 15,000 years ago. Pups from that pack accompanied their partners on their travels and were traded with other tribes until they reached every continent except Antarctica, rather than the domestication of wolves being reenacted multiple times.
I find it provocative that Homo sapiens lived in small, nomadic extended-family units for almost 200,000 years, regarding other packs as hated competitors for scarce resources... But once we learned how to live in harmony and cooperation with individuals of another species, a mere 3,000 years later we began combining into larger groups and building farming villages, then cities, and ultimately a world-spanning civilization in which we each live more-or-less in harmony and cooperation with total strangers.
This is a lifestyle our contentious Mesolithic ancestors could not have imagined. I suggest that it was the creation by humans and dogs of the first multi-species community on earth that showed us the way to do this. Without dogs there might never have been civilization.
So the next time your dog bumps into you, give him the social reassurance he's looking for as a little thank-you. He may be the reason you have this life.