Many traditions and teachers use dreaming as an analogy for the process of awakening. The word awakening itself is related to this analogy...!
Waking up from a dream is a parallel to awakening in the sense of Big Mind awakening to its own nature of emptiness and form, with no I anywhere.
And waking up to the dream, within the dream, as happens in lucid dreaming, is an even closer analogy. This is parallel to Big Mind awakening to its own nature while still being functionally connected with a particular human self.
In the case of lucid dreaming, the dream goes on and is realized as a dream as it happens. Whatever happens is realized as a dream, as form and emptiness, as the play of consciousness.
In the case of awakening, the human self goes on and is realized as the play of Consciousness, as absent of I, as a small part of the tapestry of phenomena arising as Spirit itself and as emptiness & form, and, to use another analogy: as a vehicle for Big Mind in the world of phenomena. The world of form, including this human self, is realized as Spirit itself, as form and emptiness, as the play of consciousness, and the human self continues on within this realization.
The difference is that in lucid dreaming, there is typically still a sense of I there, and it is often placed on our human self. So the consciousness that creates and is the dream is often taken as individual or human consciousness, as a property of and dependent on this human self.
In awakening, this consciousness, temporarily and mistakenly identified with our human self, is revealed as Spirit, Big Mind, Buddha Mind, Divine Mind. It is that which all phenomena throughout the universe is made up of, including this particular and infinitely small human self.
Awakening from the nightmare
Another way the dreaming analogy can be useful is in looking at awakening from the nightmare.
When we have a nightmare, we often wake up. It is just too terrifying to stay in the dream, so something allows us to wake up.
And there are many examples of where this has happened in awakening as well. Our human life becomes too terrible to continue to be identified with, so consciousness awakens to its own nature - as Spirit, Ground, emptiness and form, as all there is absent of any I - yet still functionally connected with this human self.
Shunryu Suzuki had his first clear awakening while he was hanging from a meat hook that had pierced his eye socket (!). Read the juicy details in Crooked Cucumber.
Douglas Harding said several times that the awakening happened because Douglas became too much of a nuisance and a burden.
And for me too, the initial awakening happened during a very stressful time in my teens, including after a prolonged period of physical illness (which later turned out to come from severe food intolerances).