The end of "A Midsummer Night's Dream" suggests that the entire story was, in fact, a dream. However, since this is stated by Puck, I have doubts as to whether his word can be trusted. This story has been around for a while, so surely there has been some kind of answer reached regarding this question. It is strange that such a celebrated playwright would leave a gaping loose end like this, so it is also entirely possible that I am missing something :)
"If we shadows have offended, think but this and all is mended" - Puck seems to be offering the audience the choice of chalking it all up to a dream, if they want to. It also harkens back to how within the play itself many of the participants decide that the strange things they encountered were all a dream.
I also seem to remember something from high school English about how the ambiguity of whether it was a dream or not was potentially to protect Shakespeare ("now to 'scape the serpent's tongue") in case it did actually offend anyone important, or maybe critics, but it's been a while since high school, so I may be way off base on that.
In any case, I believe the question of whether it was all a dream was intentionally left without a solid answer.