Kamen Rider Decade plays with this, as Tsukasa/Decade spends Final Chapter hunting down all the Kamen Riders, while the Riders believe that they must stop Decade's rampage in order to save The Multiverse. In the end, Decade turned out to still be Good All Along, as his trying to "kill" the Riders note actually preserving them in cards was the only way to save the Multiverse and the Kamen Rider legacy.
Star Trek: The Next Generation: When Picard is assimilated into the Borg Collective. Slightly averted in that he did not join willingly and was thus forcibly integrated into the collective consciousness, but from the point of view of Starfleet played terrifyingly straight, as the Borg gained knowledge of high-level Starfleet tactics and used that knowledge to great effect at Wolf 359.
Star Trek: Deep Space Nine: A minor example in Michael Eddington. Once the Starfleet officer sent to handle station security, he defected to the Maquis terrorist organization.
This is how you appear to your former squadmates in Mass Effect 2, seeing as how you're currently working for Cerberus, a terrorist group whose members were shoot-on-sight enemies in the first game. Ashley and Kaidan outright refuse to go with you because of it, and Tali rejoins with serious reservations about the Normandy's Cerberus-comprised crew (they attacked her people, so It's Personal). Subverted in that Shepard eventually leaves Cerberus (not to mention people like Admiral Hackett essentially considered Shepard a shadow asset the entire time), Garrus and Wrex trust Shepard without a second thought (although Garrus is reasonably concerned about the Cerberus connection), and everyone else eventually trusts Shepard once again. In fact, the only one who you can possibly kill over this is the Virmire survivor in Mass Effect 3, and even that is hard to do in standard gameplay.
Lloyd Irving in Tales of Symphonia: Dawn of the New World is seen as a murderer at first, in stark contrast to his ideals in the first game. Emil hates him for killing his parents in a brutal massacre of Palmacosta. Of course, he's not really a villain. The Lloyd who committed those crimes was Decus wearing a disguise.
Isaac in Golden Sun: The Lost Age is an unseen antagonist to the game's main character, Felix. Felix intentionally avoids contact with Isaac, because he knows they're working against one another, and wishes to avoid a fight — until Felix's supposed allies Karst and Agatio try to kill Isaac, at which point the groups are forced into an uneasy alliance. (And eventually team up for real once Felix convinces Isaac he's right.)
Felix was an opponent to Isaac's group in the first game, and The Stinger for the first game made it fairly clear you'd be playing as Felix in TLA. Neither Isaac's goal nor Felix's has changed, so they're still at odds. Effectively, it's the player who's gone rogue.
Though Felix does it in reverse, and Jenna and Sheba do it without the player realising it at the time: Felix was an antagonist who then became the protagonist, and Jenna and Sheba were both prisoners that needed to be rescued as far as Isaac knew in the fist game, but in the second game it turns out that Jenna was helping of her own free will and Sheba joined Felix's quest because she wanted to get to Jupiter Lighthouse.
Also may have happened in Dark Dawn, since Felix hasn't been seen since he left Vale shortly after the Golden Sun.
In Armored Core for Answer, AC4's main character is the pilot of White Glint, with Fiona still being his operator, which are now sided with Line Ark since Anitolia got destroyed at the end of 4. You either fight them or side with them; either way, The Raven loses the storyline fight.
It's also implied in 2 that Leos Klein is the original raven from Master of Arena.
Subverted in Metal Gear Solid 2. At the start of the Plant chapter, Raiden is repeatedly told that the leader of the terrorists is Solid Snake. Ten minutes of gameplay and one Paper-Thin Disguise later, you realize you were an idiot for thinking it was possible.
In Devil May Cry 4, Dante is an example, showing up as a villain right out of hell, and making himself a serious enemy to Nero, the new protagonist. They do end up fighting for a similar cause later, especially when it's revealed that the guy that Dante gunned down, and who got better, is the Big Bad.
You learn of a possessed and evil character in Diablo II, called the Dark Wanderer. As it turns out, he's the player character of the first gamenote More specifically, the warrior class. The other two classes also turned rogue, including the rogue..
Misleading trailers were released to make it seem like this would be Yuri in Shadow Hearts Covenant. The trailer made it seem like two new characters would be the leads and Yuri only appeared at the end after turning into a monster. When the game came out though, Yuri was the main character and almost all the scenes in the trailer never occurred.
In Prototype, AlexMercer fought to stop the infected and Blackwatch from destroying New York. Prototype 2 has him spreading the infection, including to the new player character, James Heller. The reasons for his Face-Heel Turn, given in a Motive Rant towards the end and a prequel comic, seem to be out of line with his characterization at the end of the first game. The best explanation is that he ended up seeing things that convinced him that Humans Are the Real Monsters.
J.C. Denton, the protagonist of Deus Ex, becomes one of the major faction leaders in the sequel, Deus Ex: Invisible War, and is also arguably the character who is most centrally driving the game's plot (a role that usually falls to the Big Bad). You can join his faction in one ending path (and the majority of the game's plot seems to be building up to this), but if you chose any of the other 3 ending paths, he becomes the "final boss" of the game, since assassinating him becomes one of the key endgame objectives. Denton has changed quite a bit between the two games, but can still arguably be described as a "good guy", and Invisible War is much more Gray and Gray Morality than the first game.
This seems to be the trend in the NecroVisioN series. The protagonist of the prequel ends up becoming the Disc One Final Boss of the main game, while the protagonist of the main game either becomes the Devil's right-hand General or (in the hardest to obtain ending) ends up becoming the Lord of Hell himself. In either case, it's pretty clear he'd be the Big Bad if any sequel was ever made. In both cases, they turned to the dark side with the intention of preventing a greater evil from occurring.
The sympathetic and seemingly good-natured protagonist of Mech Warrior 4 is revealed to have turned into a cruel despot in the expansion pack, and serves as a Disc One Final Boss. In his case, it may have been In the Blood, as he obtained the throne by overthrowing his evil dictator uncle.
Also, this is an explicit follow-up to one of two possible endings to the original game. Presumably, a sequel to the other ending would not feature him as a villain.
Word of God states that he was smear-campaigned by Katrina Steiner's loyalists and a vast majority of people bought it. Whether this means the events of Black Knight are actually what happens or some kind of Steiner propaganda is still up for debate (especially given the game's second half).
In Arcania: Gothic 4, the Evil OverlordBig Bad is King Rhobar III, aka the Nameless Hero, the protagonist of the previous 3 games. It turns out he's possessed by a demon lord, though, and he gets exorcised in the ending.
This happens quite a lot in the Contra series. The most notable are Contra: Shattered Soldier and its sequel Neo Contra. In Shattered Soldier it's revealed that the terrorist leader and Disc One Final Boss is in fact Lance Bean, Player 2 of the classic Contra series, who as it turns out is a Well-Intentioned Extremist trying to stop the World Government from destroying the planet, but who was driven insane by the Red Falcon cell he injected into himself to survive an early assassination attempt by the World Government. In Neo Contra, Bill Rizer (Player 1 of the classic series and Shattered Soldier) is the Big Bad and final boss, who wants to destroy the Earth For the Evulz (although it's heavily implied that he's actually an insane A.I. based off of Bill's mind, with the real Bill Rizer being The Obi-Wan character). Lucia (Player 2 of Shattered Soldier) is also a member of the Quirky Miniboss Squad and seems gleefully evil in helping Bill destroy the world. Unlike Bill, she dies without any explanation being given for her abrupt Face-Heel Turn.
Also happens retroactively in Hard Corps: Uprising, where the main character is a young Colonel Bahamut, who was the Big Bad of the original Contra: Hard Corps.
The Tekken series would have this a lot. Kazuya is the protagonist in the first game, but becomes the antagonist in the second game up to the rest of the series. Jin is the protagonist in the third game onwards, and becomes the antagonist in the sixth game.
In Tactics Ogre, there is a Gaiden Game for the Game Boy Advance called Knight of Lodis. Whatever happened to the titular Knight of Lodis? He becomes a Climax Boss in Tactics Ogre Let us Cling Together, essentially an antagonist, but not the antagonist.
In Torchlight II, the Alchemist, one of the three player classes of the first game, is revealed to still have the Ember Corruption, and has become obsessed with it. By the time the story starts, he's murdered Syl, blown up Torchlight, and stolen the Heart of Ordrak, the first game's Big Bad.
In Jade Cocoon, Levant, the main character of the first game, is one of the second game's final bosses.
During Part III of Fire Emblem: Radiant Dawn, Ike, protagonist of the previous game Path of Radiance, and Micaiah, the protagonist during Part I of Radiant Dawn, end up commanding opposing armies and clash several times, with the player switching perspectives between chapters. Ike is the boss of Chapter 3-13 and Micaiah is the boss of Chapter 13-Endgame, though both chapters can be completed without ever attacking them (and the story doesn't change even if you do).
In Apollo Justice: Ace Attorney, this is Phoenix's role - he's been disbarred for around seven years, and he starts of the game by helping Apollo convict his friend Kristoph for murder using a piece of forged evidence. After that, Apollo punches him, and he sort of vacillates between Trickster Mentor and Anti-Hero after that.
And then, in Phoenix Wright: Ace Attorney - Dual Destinies , Apollo briefly returns the favour - he leaves the agency, conducts a private investigation, and accuses his fellow lawyer Athena of murder. Phoenix even has to face him down on the witness stand, although it turns out he's doing it for a very good reason.
Agent Washington in Red vs. Blue, who makes the switch between seasons 6 and 8. Though arguably he ends up not a villain but as an Anti-HeroAntagonist, as he has understandable non-evil (if selfish) goals which just end up opposing the other main characters' goals. Wash risks his life to obtain the evidence needed to implicate The Director and is captured while attacking a secure facility. Unfortunately, the person with the evidence would rather rescue his friend than turn the evidence in to the authorities. So Wash is arrested. He then shifts to the mentality of "Being a hero sucks, I am just gonna clear my name and move on", which puts him in direct opposition with the Reds and the Blues.
Aqualad in Young Justice. After spending the first season as The Hero, he's become The Dragon in the second. While ultimately revealed to be a Fake Defector, he is forced to commit genuinely villainous acts to maintain his cover.