Suppose that we live in The Kingdom. Our wise king hires a treasurer — to mint coins, balance the Kingdom's budget, raise revenue, borrow funds cheaply, and all of the other Boring, but Practical essentials of keeping the Kingdom running. Our treasurer does an exemplary job.
Then The Usurper comes, murders the king, and converts our kingdom into The Empire, with the requisite torture chambers, Gladiator Games, and all that. The Usurper realizes, though, that in addition to torturers, he still needs a treasurer — and no one has proven himself more capable than the old treasurer from his predecessor's days, so the treasurer stays on, and continues minting coins, accounting for funds, and all that.
Eventually, La Résistance overthrows The Empire, and introducing democracy and creating The Federation. Elections are held, delegates are sent to the parliament, a president is elected — and someone still needs to run the treasury. Who is better qualified to handle the shaky finances of the newborn federation than the experienced elder statesman who served the old king and the usurper, our old treasurer? The treasurer holds onto his job, as always, and continues doing an excellent job of keeping finances in order.
A character who is Loyal to the Position is adept at surviving Regime Change with position intact. It is possible that he is simply very adaptable, or possible that he has Ultimate Job Security or Vetinari Job Security. This character is not necessarily The Quisling, or lacking principles. It is possible that the Position Loyalist regards himself as above the fray of factionalism, and would describe himself as "loyal to the kingdom, not the king." He might regard keeping the practical aspects of the state functioning as far more constructive and beneficial to the populace than involving himself with factional loyalties — and he could be right.
Then again, it could be that he's just an opportunist or The Quisling who fights for what he perceives to be the strongest side, and even if he doesn't start out that way, it's possible that the character Loyal To The Position will cross serious moral boundaries — if not a Moral Event Horizon — thanks to loyalty. If being a dutiful treasurer means signing the checks to cover the costs of building death camps, however, then a character Loyal to the Position who does that can easily become Obliviously Evil.
The lower in the hierarchy of government you go, the more likely members of the old regime are to continue into the new regime. At the bottom, an ordinary postal worker or accountant will almost always hold onto the old job. At the top, the head of government pretty much must change by definition for it to be a regime change. The question lies in the middle and near-top of the hierarchy — the directors, assistant secretaries, deputy ministers, colonels, and other fairly high ranking personnel. These usually change, but the Position Loyalist is distinguished by his ability to hold on to these positions in spite of such changes.
Such a character will often (but not always) be Lawful Neutral.
Compare Professional Butt-Kisser. Related to I Fight for the Strongest Side and My Country, Right or Wrong.
Gladiator of the Shi'Ar Imperial Guard in Marvel Comics. He serves the ruler of the Shi'ar Empire, whether that's D'Ken, Lilandra or Deathbird. Eventually, Vulcan proves too much for him, and following Vulcan's death, he reluctantly takes the role of Emperor himself.
Gateway, an Aborigine who appeared in X-Men. He spent most of his time in quiet meditation, but he also had the power to open portals, and would do so for anyone who requested it, no questions asked.
In Demolition Man, Dr. Cocteau's assistant blindly serves whoever's in charge.
In Thor, Heimdall says he's this, but when Loki takes command momentarily, he shows he is actually loyal to Asgard, not just to whoever is in charge (although he sticks to the letter of his new ruler's orders until the betrayals become unsubtle).
In Yes, Minister, and Real Life in the United Kingdom, this is the designated role of the Permanent Secretary.
In Yes, Minister Sir Humphrey says that he (and the entire civil service) is loyal to his minister regardless of party or competence. Although in practice he is loyal more to the civil service than anything else.
Sir Humphrey: My job is to carry out government policy.
Jim Hacker: Even if you think it is wrong?
Sir Humphrey: Well, almost all government policy is wrong, but...frightfully well carried out.
In fact, it's almost an inversion, where the partisan elected officials end up doing whatever the nonpartisan civil service wants them to.
In Star Trek: Deep Space Nine, Odo served the Cardassians and the Federation, not necessarily out of a loyalty to them but out of a desire to keep order.
Doctor Who, "The Invasion of Time": On Gallifrey, the Vardans invade and take over. Castellan Kelner serves the Vardans. The Vardans are replaced by the Sontarans. Kelner obeys the Sontarans without missing a beat.
In Mighty Morphin' Power Rangers, there was Finster, Rita's alchemist who was in charge of creating monsters. Although he seemed to have more loyalty to Rita than to anyone else, he seemed willing to take orders from almost any of the villains, including Lord Zedd, Master Vile, and even Goldar; the only one he refused to obey was Rita's brother Rito. (Finster didn't even seem to be truly evil, really; he was more like Punch Clock Villain.)
In Pyramids, High Priest Dios has always served whoever is currently the Pharaoh. Always.
In Night Watch, a number of people are mentioned as being turned out on the replacement of Lord Winder with Lord Snapcase (including the food taster), but the change affects the servants very little, as someone is always needed who knows where the brooms are kept.
In addition, Mr. Slant the zombie lawyer, who is in some cases an antagonist and more helpful in others (having been a lawyer for so long, he is closer to True Neutral than most others).
Valharik, the captain of the guard in Melnibone, upon Yyrkoon's taking of power in the first novel of The Elric Saga, betrayed his mistress Cymoril, Elric's Love Interest, and took her to her tower. He cut down one of his own men who tried to defend her against Yyrkoon, and on Yyrkoon's orders, he fed the poor guy to Cymoril's slaves. When Elric takes back the Ruby Throne from Yyrkoon, Valharik explains that he serves the Ruby Throne, no matter who sits upon it. Needless to say, Elric doesn't buy this, and in a truly ruthless move, he sentences Valharik to execution, with his flesh to be fed to Yyrkoon at the feast that Elric plans to hold.
Dolores Umbridge from the Harry Potter books. First she very thoroughly implements the policies of a Minister of Magic who is in utter denial regarding the resurrection of Voldemort. When we meet her again a few books later, she works for Voldemort! A less clear-cut example than most on this page, however, since she's so sadistic that it's highly likely she's in it more for the abuse of power than the job in itself. And when Voldemort is killed and overthrown, the resistance aren't very understanding of the crimes she committed under the regime. Word of God says they threw the book at her but good.
Judge Dee: Judges are moved to a different position in a different province every few years, to avoid complacency and corruption settling in.
In A Song of Ice and Fire, Varys is probably the best example, holding his position as spymaster under the Targaryens, the Baratheons, and the Lannisters. Treasurer Petyr Baelish does so too, until he decides it's prudent to get the hell out of Dodge, but in his case it's more naked self-serving ambition than loyalty to anything.
The maesters are assigned to a castle and have to remain there, serving whichever lord happens to have seized power that week. Grand Maester Pycelle is the last member of the original royal council to remain, sticking out even the wildest excesses of Cersei's regency.
The Kingsguard is expected to guard the king, no matter who he is or how he came to the throne. After King Aerys the Mad had the throne taken from him by Robert in a bloody civil war, Jaime Lannister is reviled as an oathbreaker, while Barristan Selmy is respected as a good and honorable knight. The reason being that Jaime sided with Robert's rebellion by killing Aerys (a truly horrific king), while Barristan stayed loyal to Aerys until the end. Despite this, both of them remain in their positions under the new regime.
In the Heroes of Might and Magic series, Castle Stewards are this by definition - they swear allegiance to the castle, not the lord, so if the castle gets conquered, they'll fight to protect it from the next would-be conqueror who comes along - even if it's the guy who originally hired him.
Charon, the ghoul bodyguard from Fallout 3, serves whomever holds his contract. He's initially loyal to the ghoul Ahzrukhal, but if you do a certain job for Ahzrukhal, you can get the contract in return, along with Charon's service. At which point Charon will ask to be excused for a moment and go kill Ahzrukhal.
Discussed and taken to the logical conclusion in Metal Gear Solid 3. The Boss lectures Snake on needing to be loyal to the President, no matter who the President is or who the enemy is. He assures her of his loyalty, which is great because it turns out the Boss has turned traitor and he has to kill her. By the end of the game we learn that the Boss was actually so loyal to her country, she was willing to give up her child, her husband, her heroic reputation, and her very life in order to serve her country.
This describes Pokémon in a nutshell. So long as you have the prerequisite number of badges to command a Pokemon of its Level, its loyalty is guaranteed. (Whether it likes you or not, however, depends on how well you treat it.)
Possibly describes Pikmin. Captain Olimar seems to deduce that they will loyally follow anyone who pulls them out of the ground.
In The Order of the Stick, this is what Tarquin pretends to be, serving a succession of rulers. However, he's actually The Chessmaster ruling as Evil Chancellor, and he allows the occasional revolution to remove the puppet ruler du jour in order to let the populace work out its frustration.
In Kickassia, Fritz Von Baugh appears to be this way as first, but it soon becomes clear he's trying to stir up resentment towards The Nostalgia Critic so he'll be overthrown.
Obsidian and Strika in Beast Machines don't particularly care what Megatron is up to; they simply serve whoever rules Cybertron, and when Megatron is apparently destroyed, they seriously consider siding with the Maximals. Thrust calls them out on this, arguing that if they're loyal to everybody, can they truly be loyal to anybody?
In theory, how it's supposed to work in democracies where the leader is routinely changed out every so many years. The military and the various groups of people who make the government function who aren't elected or cycled out after a few years are expected (and required, under sworn oath, in many cases) to be loyal to whoever replaces their boss, regardless of politics. The civil servant administrative tradition (as used in, e.g. the UK, Canada, France) is a well-known user of this trope.
However, it generally applies to the lower levels; in Canada at least, it's not unusual for Deputy Ministers (the civil service position directly below the cabinet minister) to be pensioned off when the governing party changes. It's also not unusual for civil servants to be shifted from on ministry to another under the same government, for any number of reasons, especially as ministers (who are politicians) also get shuffled between different cabinet positions fairly regularly.
In the US, there are comparatively more appointed positions in the civil service, so there's a greater number of changes in terms of who has what positions.
The US Military (and many around the world, for that matter) frequently rotate officers and soldiers to new assignments every few years to enforce this (as well as other reasons, such as benefits to professional development). This concept, as applied to any work environment, is a mark of professionalism.
A good Real Life example was the French statesman Charles Maurice de Talleyrand-Perigord. He was a bishop under Louis XVI, held various posts in the governments of the French revolutionary period from 1789, was Napoleon Bonaparte's Foreign Minister and was then brought back to be Foreign Minister after 1815 when Napoleon had been defeated and the Bourbon monarchs had returned. He is famously quoted as saying: "Regimes may fall and fail, but I do not." He achieved this by making sure he always backed the stronger side, even when this involved blatantly betraying his current employer. Napoleon once called him "shit in silk stockings."
He probably called him that after they had a political split over the Peninsular War. He wasn't as bad as all that, and he was quite talented, which just as much as his flexible principles is why everybody kept hiring him as senior staff. He got a worsened rap in England after The Scarlet Pimpernel got popular—the series has a really nasty villain based on him.
Anastas Mikoyan, a Soviet public servant and politician who started his career under Lenin, survived Stalinism from beginning to end, went through Khruschev's reforms and survived a coup against him and finished his career under Leonid Brezhnev. There was even a saying about him: From Ilyich (Lenin) to Ilyich (Brezhnev) without cardiac arrest and paralysis (От Ильича до Ильича без инфаркта и паралича) (Ot Ilyicha do Ilyicha bez infarkta i paralicha).
J. Edgar Hoover was director of the (American) FBI for nearly forty years, till his death in 1972, despite starting as a Well-Intentioned Extremist and progressively turning into a Knight Templar, because (legend has it) he had too much dirt on everybody in a position to get rid of him. (J. Edgar Hoover is probably the most recently deceased Real Life example we should have on this one, though.)