In Twelfth Night, Shakespeare extends a humorous exploration of identity that he had begun in The Comedy of Errors. In the Twelfth Night, Viola and Sebastian are not identical twins; it’s not biologically possible. Sebastian is a male and Viola a female, and the comedy in it all is that they cannot be distinguished from one and other by the other characters in the play.
The twins in Twelfth Night are identical only when Viola is disguised as a young man, their apparent naturalness as identical twins thus being treated ironically. Olivia’s independence as mistress of a household following the deaths of her father and brother (a situation no doubt modeled in part on the of the young Queen Elizabeth I) prohibits Orsino from dominating her.