Well, in the case of "The Legend of Korra," the characters are actually very complex as opposed to "Avatar: The Last Airbender," in which they weren't. Korra and her friends actually have lives and aren't on a fixed quest the whole time the show is going on. It chronicles a lot of stuff going on all at once in each episode, which adds a lot of intrigue to the storyline. So, the characters aren't really acting out of character as opposed to reacting differently to drastic situations. I mean, there's even a degree of normality that constantly gets disrupted by the antagonists and it's up to Korra (as the Avatar) to straighten things out.
In the case of general fiction, only one rule applys: keep your characters consistent. This isn't to say that they have to follow one strict personality trait, but rather that they shouldn't just suddenly change their attitude on a whim. For instance, my character Seraph Furlong is generally cocky and stuck up, but she has compassionate and aggressive side that sometimes comes out when her friends are in danger or she's in the thick of battle and doesn't want to die (she's a tribal outcast, so she's learned to fend for herself when she has to).