All of Shakespeare's plays were based either on historical figures or on earlier stories, often earlier plays, with two exceptions: A Midsummer Night's Dream and The Tempest appear to be original (though both feature elements that can be traced back to earlier stuff). That's why those are the two plays Will writes for Dream as payment for his inspiration in Sandman.
(Apparently there's also no known main source for Love's Labour's Lost, but that rather ruins Gaiman's scheme, so let's not worry about it.)