Reductively, the theme of Twelfth Night is the joy and pain of love. The play was written in Shakespeare's older years and he attempts to see love for all that is both good and bad about it. This may explain why Twelfth Night has a subtitle, What You Will (the only play that has one, btw). What you want to take away from it, where you are in your life, or how love has treated you over the years will affect your interpretation.
As for the characters who experience the pain of love: there is Malvolio, who falls so madly in love with Olivia that he loses all sense of reality and is eventually becomes a lunatic, having to be physically restrained. Or Orsinio, who falls so in love he likens it not to ectsasy but to disease.
A comedy first and foremost, everything turns out happily in the end and the more tender elements of love are revealed. The whole Cesario/Viola thing has been straightened out, the Duke marries Viola, etc. But throughout the merriment, there are sharp rocks just beneath the seemingly gentle waters of comedy, ready to bruise the feet of anyone who steps into its current unaware.