Affection and Grooming.
Some dogs will groom each other by gently nibbling at the back and ears of each other.
By pulling his teeth through the fur of another dog, a dog will help groom the other, showing trust and affection.
This is a self-soothing habit that your dog may have learned as a puppy.