A character wants, very badly, to be friends with someone specific. But sadly, the rules of family or society look down upon the friendship, and won't allow it. There's a number of possible reasons for this:
Prejudice. Whether it's class differences, racism, or any other difference, an entire group of people is declared "evil" and must be avoided if one is to be socially accepted.
Personal vendetta. Sometimes one family hates another, and won't allow their own to hang out with the other family. Not everyone in the family shares that dislike, however, and they might become friends anyway.
Safety. Sometimes the society or family has a fear of a specific individual, whether warranted or not. And who wants to see their friend hanging around someone who might kill them?
Bad influence. Sometimes the specific individual isn't so much a threat to the character, as to society's value system. Friends who do drugs, get into trouble, and so on, might be disallowed as company for the main character.
Code Geass uses this early on, with Suzaku trying to hide his friendship with Lelouch and Nunnally because he doesn't want them getting in trouble for being friends with an Eleven. However, after Suzaku keeps Lelouch from falling off a clocktower in full view of the school, people start treating him nicer (and it's subtly implied that Lelouch engineered the incident for that exact reason).
From The Borrower Arrietty, Sho wants to be friends with Arrietty, who had grown up with the beliefs that humans are dangerous and will cause her and her family harm.
The basis of the story in Arashi No Yoru Ni (One Stormy Night), where Gabu, a wolf, and Mei, a goat, find shelter in the same abandoned barn during a heavy thunder storm. They assume the other is their own species and end up finding out the truth the next day when they agree to have lunch together in broad daylight. Not wanting to back down from their friendship, they have to hide their pact from their respective family and clan.
In Post CrisisSuperman comics, young Perry White's parents told him to stay away from the orphanage kids. However they approved of his friendship with that nice Luthor boy.
The Fox and the Hound is a Disney Film starring two talking animals (no points for guessing their species). The Fox is orphaned and some old lady adopts it as a pet. A man who lives nearby is a hunter that just got a puppy he is training to be a hunting dog. The two animals meet each other and form a friendship, in spite of the fact that the man is training the puppy to hunt (among other things) foxes.
Lawn Dogs has one that's forbidden on multiple levels. Upper-middle-class 10-year-old Devon is friends with lower-class 21-year-old working stiff Trent, who lives in a trailer and works for the people in the upper-middle-class town.
In an early draft of the first movie Simba was this with a zebra colt named Lemuta. They watch as his mother nearly gets killed by Simba's, which freaks Lemuta out and ruins his friendship with Lemuta.
In Alphas, Gary befriends a girl named Anna. They get along very well until he finds out that she's actually one of the Big Bads. Later, it is revealed that they'd been contacting each other regularly since they first met. He's not shy about the relationship, and it is, strangely, a completely innocent friendship. No one is happy about the friendship but due to the strength she has in her community and his Alpha ability, there's pretty much nothing anyone can do to stop them.
In Grimm Monroe is a member of a wesen race called the Blutbaden, essentially the Big Bad Wolves from fairy tales. Nick is a Grimm, a member of a clan of special humans whose task is to hunt down any wesen that hurt humans or otherwise cause trouble. When wesen mothers want to scare their children they tell them that the big bad Grimm will come and cut off their heads. However, Nick was never told about what he is and he enlists Monroe's help to guide him through the lore and conventions of the wesen world. Monroe is initially reluctant to help a Grimm but over time he and Nick become friends and allies.
An episode of the Brit Com2point4 Children had mother Bill Porter warning her daughter, "No hanging around with the Rat Pack after school!" This particular snippet was used in some PBS spots promoting the program's airing in the USA.
Romeo and Juliet is probably the classic example. With their families feuding with each other, Romeo and Juliet are not allowed to hang out together.
West Side Story as well. This time it's gang wars making the friendship difficult.
Their Eyes Were Watching God: Janie[wealthy, mayor's widow, in 40s] runs off with Tea Cake[poor working-class young man] despite the fact that the entirety of Eatonville thinks that Tea Cake is only after Janie's money, and because of the 15-year age difference.
Anne of Green Gables has a very brief instance of this; after Anne accidentally gets Diana drunk on currant wine that she mistook for raspberry cordial, Diana's mother forbids her daughter to associate with Anne. Fortunately she relents eventually.
In the Warrior Cats series, the Clans aren't that fond of inter-Clan friendships, but they allow it. However in the first book, ThunderClan looked down on the hero talking with his house-cat friend Sumdge because of Clan bias. They got over it eventually.
There was a song at the turn of the century, "Stay In Your Own Back Yard," in which an old granny cautions her child not to try to play with the white children; deprived of friendship, the child pines away and dies.
Myth and Folklore
The Frog and the Snake, an African fairy tale. Frog Child and Snake Child meet one day and teach each other to crawl on their belly and hop. When they come home and show their respective mothers what they've learnt from their new friends, they're told: "No, no! You can never be friends with that family!" Snake Child is told to eat Frog Child the next time he sees him, and Frog Child is likewise warned that Snake Child will eat him. So they avoid each other the next time they see each other, and think about the fun time they had.
The Sushi Pack episode "Deep Freeze" deals with this, with Maguro striking up a friendship with Mochi Mochiato, a member of The Legion of Low Tide. The rest of the Pack is split on whether they condone the friendship, but the entire rest of the Legion is against it. There's even a Shout-Out to West Side Story, when the two groups decide to rumble over the friendship.
Occurs in Catscratch when Waffle and Chumpy Chump brother Lunk become friends.
Recess: Gus and Cornchip girl in 'The Army-Navy game.
Subverted in the 1984 Fat Albert and the Cosby Kids episode "Busted". Rudy's mother warns her son about Larry being a bad influence rather than outright forbidding him to associate with Larry. Rudy brushes off her warning however...and ends up paying for it later when he and the gang join Larry in a stolen car.