In Tangled, the Bar Brawl and escaping down the tunnel together gets Flynn friendly enough to ask why she didn't go before; The Chase, culminating in their nearly drowning, and their final escape, cements it so that Flynn no longer sulks over guiding her, and they confide in each other.
Monsters University, Mike and Sully finally become true friends after their competitive rivalry when the two have to escape a human summer camp by teaming up to scare a group of adults to power the door from their side.
In Ice Age, Manny, Diego and Sid become this during the events of the first movie.
Zootopia: Judy and Nick. At first they are stuck working together on a case because he's her only lead and she blackmailed him into helping her with the threat of a tax evasion arrest, but as the case progresses they have many harrowing experiences, including Judy saving Nick's life twice, and they become best friends.
In The Emperor's New Groove, Kuzco and Pacha initially don't like each other because of Kuzco's It's All About Me attitude. During their adventure, they are forced to work together to get home, saving each other's necks along the way, and by the end of the movie, they seem to somewhat be friends.
Films — Live-Action
The Mad Max franchise loves the trope. Justified in that in a post-apocalyptic society, trust is hard to come by.
Mad Max 2: The Road Warrior has Max and Papagallo. The Gyrocaptain tries to invoke this between himself and Max but fails although between himself and the great north tribe it seems to work just fine, since the epilogue states that he became their leader for a time.
In Alfred Hitchcock's The Lady Vanishes, Iris Henderson (Margaret Lockwood) and Gilbert Redman (Michael Redgrave) start off on the wrong foot when Iris has Gilbert thrown out of his hotel room for his noisy music-making and Gilbert blackmails Iris into reinstating him. However, when a fellow passenger on the train in which they are travelling mysteriously vanishes, the two join forces to try and find out where she's gone and why so many people are lying about her disappearance. There is a Relationship Upgrade at the very end of the film.
At the beginning of Korean table-tennis movie As One, the North Korean and South Korean ping-pong teams have been thrown together as one because their governments think it's a neat idea. The players of the respective teams dislike and distrust each other. However, by the end, when they've battled through and beaten the powerful Chinese national team at the World Table Tennis Championships, they've become best friends.
Dan and Occam in The Patriot: Dan constantly talks smack about former slave Occam, right up until the latter runs back to rescue the former in the heat of battle. From then on, Dan is honored to have Occam at his side.
In the Dawn of the Dead (2004) remake, the security guards at the mall are initially hostile towards the new arrivals, but eventually their common purpose against the zombies makes them allies. Not all of the survivors manage to work together, though, and indeed this trope is rare in the zombie movies made by or remade from George A. Romero. Usually the conflicts between survivors escalate to become their undoing.
Gandalf and Pippin come to mind. While the Fellowship were True Companions, Gandalf never seemed to like Pippin very much. Once they had fought together in Minas Tirith, lived through the siege and saved Faramir's life, Pippin seemed to have become Gandalf's favorite among the Fellowship members (especially in the movie).
Also, Gimli and Legolas:
Gimli: I never thought I'd die fighting side-by-side with an Elf! Legolas: What about side-by-side with a friend? Gimli: Aye... I could do that.
District 9: Wikus van de Merwe and Christopher Johnson.
Done in the Clash of the Titans remake. The Argos captain almost shoves Perseus's head into flames before the king calls him off, allows the monster hunters to come along as meatshields, and doesn't trust the Djinn even after they save the group. Perseus eventually comes to say he trusts the surviving men, woman Io, and whatever the hell the Djinn is.
Lethal Weapon: Riggs and Murtaugh don't particularly like each other when they first meet. But by the end of the film, Murtaugh is inviting Riggs to spend Christmas dinner with his family. And after a while, Riggs is family.
A famous example of this trope happens in A New Hope. When Luke Skywalker and Han Solo first meet they don't like each other at all, it is only after saving Leia together that their friendship begins, inspiring Han in particular to defy his original selfish character and come back to save Luke.
When the Avengers first assemble, they don't get along at all. The main arc of the film is this motley collection of alpha dogs going from "we're six guys who all happen to want the same thing" to becoming the motherflippin' Avengers.
Special mention has to go to both Captain America and Iron Man. At first, the two really can't stand one another, with Cap even wanting to punch Tony's lights out at one point, but with the fate of the world at stake, they're more than happy to drop all grudges and get their act together to save humanity from Loki and the Chitauri.
Nonhuman examples: Godzilla, Rodan, Anguirus, and Mothra. A strange group, to be sure. But each of these four became fire forged friends in different films in the Showa Era. Actually, Godzilla, Rodan, and Mothra are pretty much Toho's Power Trio. Anguirus is something like Godzilla's sidekick. Godzilla and Anguirus are adversaries during the second Godzilla film, but somehow or other ended up as great friends from that point after. How Anguirus manages to forgive Godzilla for in essencekilling him is unknown, but even the Trendmaster's toy line roster calls Anguirus one of Godzilla's staunchest allies, and most films in which they appear together as allies make it clear that if Rodan is Godzilla's Right Hand, Anguirus is the Left. Rodan and Mothra become fire forged friends with Godzilla when they team up to defeat King Ghidorah, and remain friends, or at least Friendly Rivals from that film forward.
Ah Jong and Inspector Li from The Killer, who went from being somewhat amicable adversaries to something akin to Blood Brothers when the two joined forces at the beach house to defend themselves and Jenny against the assassins after Ah Jong.
Jack the Giant Slayer: At their first meeting, Elmont is not impressed by this bumpkin Jack. After Jack rescues him and Isabelle from being cooked by a giant and they subsequently send another giant plummeting to his death, Elmont gives Jack a King's Guard badge, saying, "You've earned it", later putting the defence of the castle at risk to give Jack a chance to get to safety.
Stu Miley starts out hating the titular character of Monkey Bone. Then they sneak into the Land of the Dead together to steal an Exit Pass, learn to rely on one other, and Stu even admits that he's come to like him. Then it gets averted all to hell when Monkey Bone betrays him, steals his exit pass, and leaves Stu in limbo.
At the end of Terminator 2: Judgment Day, while Sarah isn't moved to tears by what the T-800 intends to do like John is, she still shakes his hand in respect. It's quite a thing too, considering her previous encounter with one of those things.
King George starts with a mild dislike for Churchill and his methods in Into the Storm (2009), but as the war rages on, they grow closer. A similar series of events happens with Roosevelt and Churchill.
It happens to our principal characters in the film Vacation from Marriage. They both make strong friendships with people they would've never been friends with before serving in World War II.
The Waterboy: At first, none of the Missisippi Mud Dogs football players, except Derek, wanted anything to do with Bobby Boucher. But when he proves to be such an amazing football tackle, taking them to the Louisiana Bourbon Bowl, they soon accept him as a friend.
My Way: Jun-shik (Korean) and Tatsuo (Japanese) start out as rivals during their sporting days and then enemies when the former is conscripted into the Japanese army and the latter is assigned as his officer. As they survive together through multiple battles and hardships in three different theaters of World War II, they become best friends by the end of the war.
In the climax of Jurassic World Rexie, the same T-rex from Jurassic Park and Blue join forces to bring down the film's Big Bad the Idonimus Rex. Despite Rexie having a history of battling and killing raptors, even bearing scars to prove it, she and Blue appear to have a mutual respect after the battle, and go their separate ways peacefully.
The biggest example in The Hateful 8 is the unlikely friendship between Warren and Mannix. Mannix idolizes a racist Confederate General, and Warren, who is black, kills that General after goading him into reaching for his gun. A little later in the film, the two are the only remaining people in the lodge who aren't part of the Domergue gang. Warren trusts Mannix with a gun on the basis that he was very close to drinking poisoned coffee, and Mannix returns the favour by sticking to his principles instead of conspiring with Daisy to kill Warren. Even after dealing with the gang, the two bond as they bleed out.
We're the Millers: Or better yet Fire-Forged Family. The Miller family (except Kenny, who just happens to be a Nice Guy) initially despised each other when they were paired together for the drug delivery, but they grew to care and love each other the course of the film.
The Force Awakens: Finn bonds with both Poe and Rey like this, in similar situations. Finn acts as the Guy in Back to both Ace Pilots shortly after meeting them and the post-combat high cements the friendship.
In The Devil's Brigade, this is the aftermath of a Bar Brawl. Up to that point, the Canucks and Americans had been constantly butting heads. One American fighter is ready to take a bottle to a Canuck, until a horde of rowdy loggers enters the bar.
The members of the Suicide Squad don't even know each other before being brought together on their inaugural mission. By the end of it, the surviving ones are willing to risk their lives for each other. El Diablo even refers to the team as his new family right before his Heroic Sacrifice.
Invoked in Thirteen Days. When a senior KGB official makes a back channel piece offer allegedly from Khrushchev, the Americans have to decide if it's genuine. They decide it is on finding evidence that the two served together during WW2.
In Wild Wild West, when Jim West and Artemis Gordon are first assigned to work together, they keep arguing with and undermining each other. By the end of the film, they've learned how to work together to save President Grant.
Josh and Dylan in Geek Charming. They even become a couple at the end of the film.
Dragonheart: Bowen and Draco start off as enemies, but after their fight ends in a stalemate and as they con villagers together, they become best friends willing to put their lives on the line for each other.
Beauty and the Beast (2017): LeFou becomes this with Mrs. Potts in the climax after his HeelFace Turn. When he saves her life, they work together to defeat the villagers, befriending each other in the process.
LeFou: I used to be on Gaston's side, but we are so in a bad place right now. Mrs. Potts:(kindly) You're too good for him anyway. LeFou: Yeah. Mrs. Potts:(smiles) Should we get back to it then? (LeFou nods enthusiastically and runs off with her to join the servants in driving off the villagers.)
Only the Brave: Literally. The Granite Mountain crew go from a team to being brothers through facing deadly wildfires head on.
In Life (1999), when two bit hustler Ray and straight laced Cluade run afoul of a speakeasy owner in early 1930s'New York, they agree to smuggle up some moonshine from Mississippi to pay of their debt, they immediately dislike each other, and agree to do the job on the condition that they never see each other again. While procuring the moonshine, Ray is conned by a local card-shark, said card-shark is then killed by the corrupt sheriff who frames Claude and Ray for the murder, and they are sentenced to life. As the years turn decades, they eventually come to see each other as friends and at the end, they fake their deaths, escape prison, and happily go see a New York Giants game.
In Avengers: Infinity War, Doctor Strange makes it explicitly clear to Tony and Peter Parker that his allegiance is only to protecting the Time Stone - and if it comes down to it, he'd let both of them die in order to save the stone. But on Titan, he ends the battle with Thanos by giving Thanos the stone in order to save Tony's life. However, Strange's final line in the film implies that giving Thanos the Time Stone, leading to his inevitable destruction of half the universe, was necessary in order to overcome and defeat him.
Prospect: Ezra and his outlaw partner rob Cee and her father, ultimately causing the deaths of Cee's father and Ezra's partner. After that, stuck on an alien world, they're forced to cooperate and ultimately form a loyal team.
In Silverado, Mal, a black man, tries to go into a bar for a drink, but goons working on behalf of the racist owner try to attack him and throw him out, though Mal manages to fight them off. When the sheriff arrives, the owner claims Mal went crazy and attacked the place on his own, but Emmett, who was there with Paden, speaks up for Mal, allowing him to walk out. So, when they get chased out of town by a posse led by the sheriff (because Emmett busted his brother Jake, along with Paden, out of jail), Mal returns the favor by firing on the posse until the sheriff gives up and orders them to leave.
Jake: This a friend of yours? Paden: He is now. Jake: Who is he? Paden: Oh, a guy who got run out of town. Emmett: Just like us. (Mal tips his hat in greeting)
Parodied in Super Troopers 2 where, after Archambault gives an impassioned speech about how he was wrong about the Americans and how he's proud to become one if the State Troopers are what the American people are, they learn the takeover isn't happening and immediately begin fighting once more:
Rabbit: Hey! We just saved your lives do you remember that?!