Alice in Wonderland, by Lewis Carroll, is an example of the "literary nonsense genre," and has been popular for many years, with children and adults.
It is easy to see why Alice's experiences might be perceived as a dream. Things take place underground that are impossible in the real world. The first example is that Alice meets a talking rabbit, dressed and holding a watch in his hand, concerned for being late.
…suddenly a White Rabbit with pink eyes ran close by her.
There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, “Oh dear! Oh dear! I shall be too late!” …when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket or a watch to take out of it...
Next Alice slides down the rabbit hole, something of an impossibility unless the rabbit is rather large, or Alice very small. Her comment in Chapter Two expresses the sense of her adventures:
“CURIOUSER AND CURIOUSER.”
Other dreamlike experiences include potions that make one large or small. Alice is able to talk to animals, like the mouse that goes swimming by. Alice again meets the White Rabbit, and is ordered around by him. She gets stuck in his house from a new potion, and the rabbit wants to burn her out. This, too, is dreamlike, but darker, more a nightmare. Alice escapes the White Rabbit and the other animals. The Caterpillar smoking the water pipe is also "the stuff that dreams are made of."
The baby that turns into a pig is quite imaginative, as is the famous Cheshire Cat.
“Please would you tell me,” said Alice, a little timidly, for she was not quite sure whether it was good manners for her to speak first, “why your cat grins like that?”
“It's a Cheshire cat,” said the Duchess, “and that's why."
Alice makes it into the garden. There, she sees playing cards painting! Some fear is introduced when Alice learns that if the Queen is aware of the decorating mistakes taking place in the garden, heads will be lopped off.
The Queen invites Alice to play croquette, a very unusual and chaotic version:
The match is played with flamingos for mallets and hedgehogs for balls...
In the last part of the story, there is a trial where the Jack of Hearts is accused of stealing tarts. Many of those taking part in the trial are creatures that Alice has already met. Here there is a great deal more happening that makes Alice's adventures seem unreal and dreamlike. There is no logic present, and the "rules" followed "above ground" are not followed here. As the madness grows, so does Alice, as well has her attitude, and she starts to speak up, criticizing the mayhem. The Queen turns on Alice, who defies them all because they are only playing-cards, after all.
“Hold your tongue!” said the Queen, turning purple.
“I won't!” said Alice.
“Off with her head!” the Queen shouted at the top of her voice. Nobody moved.
“Who cares for you?” said Alice (she had grown to her full size by this time.) “You're nothing but a pack of cards!”
The cards fly through the air at her and Alice wakes up from what has been a dream.
All of these events give one the sense that Alice is having a dream, as well as the foreshadowing in the first chapter:
Alice was beginning to get very tired of sitting by her sister on the bank...