Military dogs always outrank their handlers.
Working military dogs are NCOs — noncommissioned officers — and are always one rank above their handlers. Some say that tradition was started to prevent handlers from abusing the dogs (it would count as assaulting a superior officer, which has serious consequences), but it's also just a sign of respect for the dogs. After all, one dog will go through training with multiple handlers, sometimes even dozens.