What is life, but a dream within a dream? {fao Tosh}.
No, I don't think it is. If life was a dream (even within a dream), then nothing would really matter would it?
Buddhism doesn't teach this. It teaches that things aren't
inherently real, and neither are they non existent.
It teaches the truth is in some subtle area between these two extremes (the extremes being, everything is real, and nothing is real); that's why it's called The Middle Way (also the middle way between the two extremes of eternalism and nihilism).
It's too complex for me to fully explain - I don't fully understand it myself - I'm just working my way through a commentary on the Heart of Wisdom Sutra (which explains this stuff), and it's tough going; though it's analytically razor sharp. The Buddha geezer was definitely a radical thinker; though he didn't invent any of this; he just explains the way reality is and has always been and; a direct perception of which (which is far deeper than mere intellectual knowledge) is Enlightenment itself.
But as to the dream analogy you gave, I've heard a similar Buddhist one that doesn't explain the nature of reality, it just asks us to question what our innate belief of what reality is.
It says something like, when we're dreaming, we think the 'dream world' inherently real. If we knock an object in a dream, it'll feel real. If we're 'with a woman' in a dream, she will feel real. But then we wake up, we realise it was all a dream.
And it goes on to ask 'isn't our 'waking world' a little bit like that?' It basically points out that in the dream, everything in it feels real, but it's our mind that creates it. In this vein, another word for Enlightenment is 'Waking Up'!
But Buddhism does not teach that everything is a dream. This would be classed as a wrong view; big style. Thinking about it, I think Buddhism teaches that things exist LIKE a dream; just they're NOT a dream.
Hope that helps.
Now wake up!