They're not leaders of countries necessarily, but likely leaders of soldiers. These are the people that if I was a kid again, I'd say "I want to be like them when I grow up!"
Interestingly, I could not come up with any commanders from novels, so the ones below are all from animation or games. I'm not sure why that is, but I suspect it might be because a lot of military fantasy and science fiction is pretty gritty, and I tend to not idealize those commanders as much, though there is certainly one gritty commander on this list!
Optimus Prime (Transformers)
He is my ur-example largely because of the age at which I was introduced to him as voiced by Peter Cullen (and seriously, bringing Peter Cullen back was the best thing the Michael Bay movies ever did).
Optimus Prime cares about the soldiers beneath him, but is willing to make unpopular decisions if it's the right thing to do. I liked that he was always level-headed, never irrational, and most importantly, he could admit when he was wrong. You got the feeling you could trust him, even if he was a giant robot from another planet.
I don't think that I ever viewed him as a father or big brother figure, even in universe, but he was cool character to look up to and my favorite out of all the 80s Transformers. I even had his toy.
Commander Hawkins (Voltron)
Most people are not going to remember Commander Hawkins because he was in the "other" Voltron, the Vehicle Team. It probably didn't hurt that he was also voiced by Peter Cullen, who didn't change his voice much between Prime and Hawkins.
Hawkins was an usual character for me to latch on to as a kid, because he wasn't one of the Voltron pilots. He stayed on the command ship and gave orders, so he would be the guy the team would argue against when they wanted to follow their hearts rather than his instructions.
But even if they didn't like what he had to say, you got the impression that Hawkins was fair, and he actually pranked his disobedient team leaders once after a mission that only succeeded because they didn't listen to him. They were willing to take any punishment he was willing to give them, and the punishment they thought was coming, was actually more of a reward.
Robin (Dark Wizard)
If Hawkins is obscure, then Robin is downright forgotten. Dark Wizard was an old fantasy strategy game for the Sega CD, and Robin was one of four playable army leaders. I loved her for being a kickass female knight in functional armor.
Back then, and even now, it's hard to find games with female protagonists, and here's Robin who serves as knight on horseback with better melee stats than magic ones. This lady was all about leading her army into battle to retake the continent from the titular Dark Wizard.
If she picked up a love interest along the way and agreed to marry in him in the ending, why not. It's a bonus. He asked her to marry him if he won the duel at their victory banquet. She kicked his ass and basically said something like "WTF, did you think I wouldn't like you if you couldn't beat me? I like you anyway, let's get married." Teenage me loved this. (Actual dialogue was much cheesier, but that was the take home message.)
Xander (Fire Emblem Fates)
Depending on which version of the game the player is playing, Xander might never take on a real command role, but along the Birthright storyline, Xander is very much a commander and unfortunately he becomes the enemy one.
I played Conquest first where I totally fell in love with Xander for being my favorite type of knight character, who is stuck between his principals and his duty. As the eldest of the Nohrian royal siblings, he is heir to the throne of Nohr and shoulders the burden of a temperamental, maniacal father as well as the future of his nation. Though not blood-related to the player's avatar, he is adamant that they are a welcome part of his family.
The worst part of starting down the Birthright storyline was turning away from Xander and fighting against him, because I knew that I would have to kill him eventually. When the battle finally happens, Nohr is practically finished and he actually has lower stats than a boss should at that level, because he doesn't actually have the heart to kill the player.
Erwin Smith (Attack on Titan)
Last, but certainly not least, is Commander Erwin Smith from Attack on Titan, who inspired this post. I won't mention anything exclusive from the manga, but Erwin hits all the right respect buttons. He's saddled with the unenviable job of leading the least popular branch of the military into gut-wrenching odds, and yet he throws himself completely into his work.
Nothing gets in Erwin's way. If the best chance to capture an enemy spy involves endangering civilians, he will take it. He might not be happy about it, but if you want a person willing to do anything to ensure the survival of humanity, Erwin's a good pick for the job and his soldiers know that. Erwin can ask the impossible of them and they'll do their best to deliver.
And particularly in the anime, when Erwin bellows for his soldiers to "Dedicate your hearts!" you want to follow the guy into battle, even though you know there's going to be a body count. The opening song for the second season is taken specifically from his words.