Generals, monarchs, presidents, emperors, the Doctor out-ranks them all. His lack of an official rank on any of the worlds he visits is immaterial, because if he’s there it stands to reason that his presence is needed, regardless of whether or not it was requested. The TARDIS Always makes sure he shows up wherever he can do the most good; time-lines need to be preserved, at all costs.
So wherever he finds himself, he studies the situation, and then takes over. People may not know how to ask for his help, but they get it anyway. It’s what he does.