This behavior predates and transcends the human species. Most mammals, some birds, and even a few fish engage in "friendly" fights, usually between males (but not always), as a form of social interaction (If you've ever been around a litter of puppies or kittens, you know what we're talking about. There are times you're not sure if they're playing, or if one stole the other's food and they're having an actual knock-down drag-out.) Little everyday scuffles burn off energy, reduce tension within the group, and keep the hierarchy in balance. It's also (supposedly) 'training' in young members of a predator species (like kittens). Some animals even have sex (in a non-reproductive context) to establish dominance or form social ties.
Supposedly this tradition was started amongst the English nobility by Oliver Cromwell. Dueling over insults had gotten so out of hand that Cromwell encouraged a joking, insulting familiarity among his friends, and it became the style among the upper class. Centuries later you're still expected to "take the piss".
The relationship between Britain and Australia is probably the clearest-cut example of Vitriolic Best Buds being applied on a national level. For all the sporting rivalry and "convict"/"pommie" sniping, the two countries get on surprisingly well with each other.
This frequently occurs between Britain and much of Western Europe:
The French think Brits are uncultured barbarians and Brits think the French are lazy nancy boys (admittedly, this the British view of anywhere in Europe south of Dover and west of Germany). The two have been fighting wars for the best part of a thousand years, but when it comes down to it, they get on reasonably well. Even when Britain and France were at their bitterest, the Brits eagerly guzzled claret from Bordeaux and the French gladly studied British economic and political theory and practice (and took a few recipes for custard, though they won't admit it).
With Germany. Brits talk about the war and 1966 and Germans talk about almost every football match since 1966. But Britain loves German beer and German accents. (Though many people are under the mistaken impression that not only are Austria and Germany one place, which in fairness they were for seven years, but Arnold Schwarznegger is German).
Less so with the Spanish. The Spanish hate the Brits for Gibraltar. The Brits don't care; they're too busy taking over Ibiza.
The US is like this with Britain as well. Some of the US thinks that they're wimpy tea-drinking mustachioed upper-class crumpet-munchers, and most of Britain sees Americans as crazy gun-toting obesity-burgers. Even so, a good portion of the American population admire the perceived sophistication of British culture, and the Brits... still believe Americans are crazy gun-toting obesity-burgers, but in a good way.
The Netherlands has this kind of relationship with Belgium. They often throw jokes about dumb Belgians and boring Dutchies to each other, but in the end, they're best buddies.
Authors G. K. Chesterton (devout Catholic with conservative social views and opposed strongly both to capitalism and socialism) and George Bernard Shaw (vegetarian, socialist, and atheist — "Christianity would be a good idea if anyone actually tried it.") frequently debated each other viciously over political, social, and moral issues, then would go have a few rounds at the pub afterwards. Both were Deadpan Snarkers with a fondness for epigrams and wordplay.
Chesterton: George, you look like you came from a country in a famine!
The mainly English-speaking countries (the US, UK, Canada, Australia, New Zealand, and Ireland) are a big family of these, often with branches of the family acting like this as well.
Canada's provinces are a bit of a semi-dysfunctional family. Anglophones and Francophones look down on each other. The Western provinces (British Columbia, Alberta, Saskatchewan, and Manitoba) like to pick on the Eastern side, focusing on Ontario and Quebec. The Maritime provinces (Nova Scotia, Newfoundland, New Brunswick and Prince Edward Island) moan how they never get the cool stuff. Everyone bashes Ontario or at least Toronto. But when the chips come down and someone needs help, they jump in to help and they really do care about each other. And nobody but Canadians are allowed to make fun of each other. (Well, maybe the US. Sometimes.)
Between Alberta and Toronto, there the relationship is more strained, as due to some unpopular bills passed, it gave Alberta less sovereignty over its oil. And some of these bills have caused environmental damage, along with causing health problems for those who live near the Oil Sands (the area in northern Alberta where oil is located) and natural gas deposits. Despite this, when the chips are down, any Albertan still feels loyalty to Canada as much as any other province.
Canada and the US are this. Most of their interaction consists of ripping on each other, but in the end, even if the Canadians are too Tsundere to admit it, we all know that one country isn't complete without the other. ♥
The US talks a lot of smack about Canada, but a large chunk of Americans don't take too kindly to other countries giving Canada a hard time. The US loves Canada, even if they show their love with all the class and tact of a 12-year-old boy with a crush. Who sometimes fancies himself as the school bully, and wants to act "tough", while still having a big heart and confused about himself, while Canada is the little softy kid in the schoolyard, that the US wants no one else other than the US to pick on, because anyone else always takes it too far. U.S. and Canada would be the two countries the most interesting to psycho-analyse. Who wants a group therapy? And yes, this means that Canada is the nerdy girl who is too focused on her studies while pining over that bad boy America who skips English class to go smoke in the boys room, all while thinking, "Oooh, I bet I can change him."
Meanwhile, Canada's relation to Mexico is night and day compared to the US. While both countries do appreciate Mexican beers and food; the US tends to have a hatedom of Mexico (usually due to rampant crime, drug running, and illegal immigration), and only uses it as a vacation destination and cheap labor. Meanwhile Canada has an openly good relationship with Mexico.
To be fair about the U.S.-Mexico relationship, for every American hater railing about illegal immigrants there's another two Americans arguing for improved immigration so there wouldn't be illegals in the first place. There's more talk nowadays about ending the War on Drugs that's made the border states on both sides unsafe. And most Americans and Mexicans would agree that, as neighbors, we've been pretty okay.
This is the kind of relationship that exists between the states that made up the Union and the Confederacy, for obvious reasons. The antagonism created by the Civil War still hasn't dissipated much, but at least the North and the South are no longer archenemies and the US (begrudgingly) admits it's better off together than apart. Just expect a lot of jokes about accents and rednecks and those damn Yankees.
Australia and New Zealand have a similar relationship. Sure, they might be merciless to each other at the sports ground, but if any other country was to try and invade one of them, or a national disaster was to strike, the other would be the first to help, and not just because they're close neighbours. Considering how open the Australia-New Zealand border seems to be, it's part Heterosexual Life-Partners and part Vitriolic Best Buds.
US and Australia seem to be a mild case of this and Bash Brothers... both are loud, boisterous nations with a lot of crazy folk. In a weird turn of events, the fighting tends to be in regards to who is more Crazy Awesome, rather than who is less sophisticated or uncouth... Americans see the Aussies penal colony status and general rugged nature as a direct affront to their rednecks and general insanity, but any country fool enough to mess with them has to deal with the pair of them trying be the first to mess you up.
The Republic of Ireland and the UK in general, but in particular England, naturally. The Irish do love banging on about the past - moaning as a national pastime is one of the many things they have in common with their dear neighbours! - but they really do love them. A 2004 study by the British Council in Ireland showed 80% of Irish have a favourable view of Britain - more than in France, Germany, or even the US. Not to mention that when the Irish economy ever so impressively tanked a few years ago, the UK offered loans on top of their contribution to the international funds that went to prop Ireland up. ("You're Ireland. For all the ribbing, we like you too much to see you sink.")
Also the Republic of Ireland and Northern Ireland, to some extent (the South's response to the WWII bombing of Belfast comes to mind), though it's light on the vitriol these days.
Not to mention that when the Queen went on a state visit to the Republic of Ireland (the last time a British monarch did this was in 1911, when it was still part of the UK), the Irish population went wild.
Finland and Sweden also have a rivalry in sports and the Finns have a habit of making jokes about the Swedes — mainly about their sexual preferences (in general, Finns joke about Swedes being gay, as Sweden abolished its sodomy laws long before Finland—not that the laws were really enforced that much in the first place in either country). The Norwegians apparently also have a habit of making fun of the Swedes, and the Swedes make fun of both the Finns and the Norwegians. Still, when the push comes to a shove the Nordic countries almost always support each other in for example political issues.
Note, however, that Norwegians tend to make jokes about Swedes being stupid, not about their sexual preferences.
This goes both ways. The jokes are mostly the same as well, just with exchanged nationalities. And even Norwegians will share in the laugh when either (or both) Danes and Swedes jokes that Norway is the country neither wants.
In Major League Baseball, St. Louis Cardinals and Chicago Cubs fans act this way as a whole—if a person attends a Cardinals/Cubs game, they'll hear a lot of verbal jabs and intense cheering for both teams, but it will have a generally more friendly feel than a Boston Red Sox/New York Yankees game will. This looks like a Type 1 at first because the Cardinals have more to boast about in the long run, but quickly becomes a Type 2 if the Cubs win at Busch Stadium.
This is usually the case with sports rivalries, with the exception of the really heated, bitter ones (like Yankees/Red Sox). A person's favorite sports team is a fairly personal decision that tends to be most influenced by things people don't have much control over, like where they grew up or which team their parents supported. Most sports fans, even hardcore ones, recognize this and aren't about to fault their friend from Philadelphia for rooting for Philadelphia teams (for example) against the home team. It's when people's choices are based less on personal history and more on who they think has the best chance of winning that the vitriol starts flying. (For example, it's hardly just Red Sox fans who get angry at the fact that there are numerous Yankees fans who don't have any sort of connection to New York.)
In the American News arena, you have political pundits James Carville, a passionate Democrat who worked for the Clinton campaign, and Mary Matalin, a staunch Republican who worked for George H. W. Bush's campaign. They often appear together on CNN with opposing viewpoints. They've been Happily Married since 1993. (Their secret? No shop talk at home, and certainly no political talk in front of their daughters.)
Bill O'Reilly and Jon Stewart. Despite being on opposite ends of the spectrum and slinging barbs at each other almost nonstop, they also seem to regard each other as worthy adversaries and have appeared on the other's show multiple times over.
Boston and New York. More than just a baseball rivalry. On the surface, they hate each other, but they have more in common than they like to admit, and Bostonians do travel down to New York quite often to take in the sights and the like, and the same goes for New Yorkers. Both cities have instantly come to help when disaster befalls the other, such as during the 9/11 attacks and more recently the Boston Marathon bombings.
Any actors who spend a decent amount of time together almost inevitably turn into this, because they spend so much time together and have to go through so many emotions, they often resort to teasing each other to get a laugh and let off steam. The best examples seem to come from Doctor Who, as the actors playing the Doctor and his companion almost always fall into this, with David Tennant / Catherine Tate and Matt Smith / Karen Gillan probably tying for the Best Example, although Jensen Ackles / Jared Padalecki / Misha Collins are a very close runner-up.
William Shakespeare and Ben Jonson had a professional rivalry, though how much of it spilled over into their strong personal friendship is anyone's guess. At any rate, it's amusing to picture them as a swift English cutter and an overbearing
Typical in Bavaria (at least among older men in the countryside). There's this joke about a butcher and his customers:
Sepp: "Hä Hans, gib ma amol drei Boor vo deine greislichen Pfälzer, du Leitbscheisser, du windiger!" (hey Hans, give me six of your horrible Pfälzer [sausages], you sleazy rip-off!"
Hans the butcher: "Für dein Saumogn taugns allawei! No, du gschwollkopferter Bauernfünfer!" (They're still good enough for your pig-like stomach! You fat-headed hick!)
Tourist from Prussia: "Geben Sie mir bitte hundert Gramm von ihrer verfaulten Salami, Sie Vollidiot!" (Give me 100 g of your rotten salami, you damn idiot!) It didn't end well for the latter.
The relationship between Austria and Hungary. Even with all the historical rivalries and grievances (such as the failed 1848 Revolution), the two countries remain close to each other. During the Cold War, Austrians welcomed and for a time felt the bigger bulk of Hungarian refugees fleeing the fallout of the failed 1956 Revolution. While today, both are intertwined in various ways and despite occasional bickering are on very good terms.
The German-speaking nations. They all dish out merciless teasing to everyone else, frequently ridiculing each other's accents and dialects of German (Swiss German suffers particularly badly!), and attempting to one-up each other with regards to cultural achievements, but it's all in good fun, and aside from the deep historical and cultural connections they share, politically they're all very close and on good terms.
Despite their public image of being arch foes, this is really the relationship between Microsoft and Apple. Microsoft is first and foremost a software company who wants their products on every piece of hardware imaginable while Apple is first and foremost a hardware company that uses their proprietary software as a selling point. They only really compete when those two paths overlap and are otherwise pretty friendly with each other. It helps that Macs would be useless without Office and iTunes would never have become the de facto standard for digital music if it wasn't available on Windows. They also have a mutual enemy by way of Google who has been stepping on the toes of both their established markets.
Hunter S. Thompson - author, journalist, boozer, doper, Center-Leftist extraordinaire - and Pat Buchanan - author, political pundit, speechwriter for Richard M. Nixon, hard-core Right-winger - were very good friends for over forty years. Thompson said of Buchanan, "I recognize quality in the enemy. I like him. We disagree almost violently on so many things it's actually a pleasure to talk with him."
Texas's premier universities, The University of Texas and Texas A&M, have this relationship with the former treating the latter like mentally deficient rednecks and the latter treating the former like self-important, "tea sipping," snobs, but the minute something bad happens (A&M's bonfire collapse being a prominent example) both are the first to rush to the other's side. And don't get either of them started on Oklahoma.
Science Fictionfandoms. with the top examples being Star Wars and Star Trek. Fans of each will never miss an opportunity to tout their own franchise's accomplishments while ripping on the other's failures; "Those prequels were sooo lame," - "Were those Special Effects in The Original Series store bought?" But the truth is fans of one have at least watched the other and generally respect the other's status as a pop-culture icon. Both fandoms will generally also do a fair bit of ribbing to that other big sci-fi phenomenon, Doctor Who.
And all the rivalries will be forgotten completely if they need to team up against bigots. Or Twilight
Anderson Cooper and Kathy Griffin. He's a journalist, very straight-laced and stoic; she's a comedian, very loud and brash. Their entire friendship seems to hinge on Kathy doing everything in her power to push his buttons.
The Green Bay Packers and Chicago Bears. American Football hath no greater rivalry. But it's all in fun. Even if the Bears do suck.
Get two Boisterous Bruiser types behind the same table, add some alcohol, shake, get a insult fight, and may be a real fight. Expect them to be back at the table sharing drinks and stories 5 minutes later.
This is all too common in the Military:
This is generally the form that Interservice Rivalry takes. As much as the five different services of the United States Armed Forces make fun of each other and use less-than-complimentary nicknames (Jarhead, Grunt, Squid, Flyboy, Puddle Pirate), God help any civilian who tries to join in on the insults.
On the other hand it's surprisingly averted (mostly) between Canada's Army, Air Force, and Navy. Unlike the U.S, they're all part of one service and most units consist of a mix of the three elements.
This is very common between the Canadian and U.S. Forces serving together on tours. They'll do nothing but make fun of one another's everything, but they'll also fiercely protect one another.
Common amongst Military members as well. It's not at all uncommon for two members of a unit to dislike one another, but you'd better believe they'll look out for one another when the chips are down.
In the US Supreme Court, Justices Ruth Bader Ginsburg (one of the most liberal justices) and Antonin Scalia (one of the most conservative justices) have spent their careers on the bench trying to dismantle everything the other believes in, with each putting their own kinds of dry barbs at the other in their respective opinions. They are also great friends, have dinner at least once a week, regularly attend the opera together, and their families go on vacation together. (It helps they've known each other for a very long time—although Ginsburg joined the high court seven years after Scalia, they served together on the Circuit Court of Appeals for the District of Columbia Circuit for four years—Ginsburg served 1980-93 and Scalia 1982-86—and before that were colleagues in the DC legal community.)