Kids shows do occasionally kill off characters. The Lion King was mentioned above. The Princess and the Frog is another example.
I think they could quite easily kill off Luna, Celestia, or other supporting characters, but to avoid alienating a significant portion of the fanbase, the death would have to be meaningful and help progress the other characters. More minor characters could be killed off just as easily as The Simpsons killed of Maud Flanders - think Granny Smith.
Killing off one of the mane six is a trickier proposition. If they did that they'd unavoidably lose fans. However, making such a brave change and doing it well could also help cement other fans. Swings and roundabouts.
They could kill off Rarity as part of a multi-episode plot which involved her sacrifice being meaningful and somehow helping save her friends, and/or Equestria. Of course for the FIM formula to keep working, they'd need to find another character to fill her hooves. The obvious choice would be Sweetie Belle. Her gaining her cutie mark and taking Rarity's place in the group could form part of the plot line. As much as I am fond of Rarity, part of me would really like to see a plot like that.
The same plot line could alternatively work for Applejack and Applebloom.