As a child, I think, I kept the Alice books in a different box in my brain from other books about imaginary children. I don't think they were read to me – there was "a war on". I think I puzzled them out when I was about seven or eight, younger than ­Alice Liddell was on the famous "golden afternoon" in 1862 when she and her two sisters rowed from Folly Bridge, Oxford, to Godstow with the 30-year-old Lewis Carroll and his clerical friend Robinson Duckworth, and were told the first version of the story. A child reader's imagination inhabits the world of a book in many different ways, depending on the book. She walks deep into imaginary forests; she saves desperate beasts; she flirts with brave boys. The Harvard academic Maria Tatar has observed wisely that children do not usually "identify" with fictional children – they stand a little apart inside the fictional world and intensely observe the people and the action. But Wonderland and the world through the Looking Glass were, I always knew, different from other imagined worlds. Nothing could be changed, although things in the story were always changing. There was, so to speak, nothing going on in the hinterland of the clearing with the Mad Hatter's tea party, or beyond the Red Queen's garden gate. Carroll moves his readers as he moves chess pieces and playing cards. This is not to say that the reader's experience of the world is not vivid, enthralling and ­entirely memorable. It is just different.

Spaces in these books succeed each other with the arbitrary reality of real dreams, from the long fall through the earth to the hall of locked doors to the pool of tears. There is no other book in which both sizes and distances are so problematic: Alice expands and diminishes; she has to learn to move backwards to go forwards when she is through the looking glass; progress in the looking-glass world is in mad rushes and jumps at inordinate speeds across the chessboard. Even as a child I sensed that this was not surreal nonsense – it was some other kind of order, like the wonderful orders we now see in the fractal geometries of chaos. Another thing which is odd about reading Alice is that the reader – even a reader aged seven or eight – can never stop thinking about the language. The texture of reading Alice is a series of linguistic puzzles, contradictions and jokes, of which Humpty Dumpty's assertions of his own arbitrary power over words (a word "means what I choose it to mean") are only the most striking. Alice is as much part of this linguistic tissue as the creatures she meets. As she falls through the earth she doesn't feel terror, she thinks, she talks to herself and analyses what is happening and may happen. She is prepared to give as good as she gets in arguments with pigeons, caterpillars, frog footmen, smiling cats and red and white queens. Her main emotion is trying to make sense against increasing odds.

The insistence on language in the experience of reading Alice is intensified by the wild poems. As a child I could sense that these were parodies of "real" respectable poems; Alice tells you so – she can feel "You are old, Father William" going remorselessly wrong as she recites it. "Jabberwocky" haunts the rhythms of the brain, but the nonsense words have meanings, which the reader is eventually told. Order and disorder are very close. The intellect offers more delight than the emotions – perhaps our first prolonged experience of intellectual excitement.

I store books in my head with half-visualised mnemonics. The Alice books sit apart as a kind of cubic cat's-cradle of brightly coloured threads – red, white, black, grass-green. I now also think of the impossible buildings and worlds in the drawings of MC Escher.

Alice's Adventures in Wonderland was written in 1862 and published in 1865. Through the Looking-Glass was published in 1871. The great children's books that shaped the imaginations of successive generations came later and many were written around the turn of the 20th century. Kipling's Jungle Books and Puck of Pook's Hill, E Nesbit's tales of children meeting psammeads and phoenixes and other opinionated beasts, George MacDonald's tales of Curdie the miner and his princess, L Frank Baum's tales of the land of Oz, Frances Hodgson Burnett's The Secret Garden and Little Lord Fauntleroy, Mrs Molesworth's The Cuckoo Clock, Kenneth Grahame's The Wind in the Willows and JM Barrie's Peter Pan, even Treasure Island, have children making their own lives and fates in strange worlds outside the daily experience of family and school. Children in these books have a kind of emotional and moral autonomy which is new in literature. The child reader feels their problems, decisions and dangers differently from those of either children in real fairy stories (Hansel and Gretel) or children in novels who will grow up – Pip in terror by his parents' gravestone, Oliver Twist in the orphanage, David Copperfield tormented by the Murdstones, Jane Eyre in the Red Room, or furious, sulky Maggie Tulliver.

Some great characters in children's books are orphans, or part orphans, or temporary orphans whose parents have gone away. Kipling, in his autobiographical story for adults, "Baa Baa Black Sheep", one of the greatest stories I've read, tells of children suddenly separated from parents for five years in India and sent to stay with a gloomy religious tyrant, who persecutes the boy and does not notice he is going blind. One of the most moving orphans is Mary in The Secret Garden. Mary is doubly isolated. She is born in India to a fashionable flibbertigibbet mother who neglects her and leaves her to the care of servants. Her mother is then killed by cholera, along with most of the household, and the uncomprehending child is discovered alone in the house of death. The fact that she does not quite understand what has happened arouses the reader's sympathy at the start. She is a disagreeable, self-centred child, sent to stay in the Yorkshire house of an invisible, absent uncle. My childish responses to Mary's attempts to make sense of the world were the opposite to my response to Alice. I felt protective towards her and, at the same time, I did see the world from inside her. I was embarrassed with and for her. Embarrassment is a great point of sympathy between reader and character. (Alice is never really embarrassed, although the people of Wonderland constantly try to drive her into that state.) Servants and ordinary people are kind to Mary and teach her kindness. Yet her own cussedness and capacity for tantrums turn out to be a strength when she meets the cosseted and neglected invalid Colin, another self-centred child – seen by the reader, I think, through Mary's eyes as she hectors him into ordinary life.

Another orphan in a strange world is Griselda in The Cuckoo Clock, who goes to live with two great aunts – the reader works out that this is after the death of her parents. In this old house the "stepmothers" are kind and gentle but the child is isolated and thoughtful – and again the child reader can sympathise with her isolation. She makes friends with a magical cuckoo in a cuckoo clock who takes her to strange worlds – not just "fairyland", as she hopes, but other places full of butterflies or nodding mandarins. She even visits the ballroom of the old house in the past and sees her beautiful, laughing young mother dancing. Both the real and the magical characters are ­anxious to show Griselda how to behave well, to do her lessons, not to sulk, not to rebel. Again the child reader sees the world from Griselda's point of view, learns as she learns, feels her pleasures and anxieties. Mrs Molesworth is a very present voice as a narrator: "For fairies, you know, children, however charming, are sometimes rather queer to have to do with. They don't like to be interfered with, or treated except with very great respect, and they have their own ideas about what is proper and what isn't, I can assure you." This is the voice of the Mother Goose storyteller, and does serve to distance Griselda – we do not feel her griefs or joys intensely as we feel those of Mary in The Secret Garden. We are being told a satisfactory tale. We know it must and will end well.

Two solitary children I thought of when searching for analogies with Alice are very different from her, and from each other. They are Mowgli in the Jungle Books and Dorothy in The Wizard of Oz. Dorothy is literally torn away from her already orphaned life with Aunt Em and Uncle Henry in Kansas when a tornado carries her house away to the Land of Oz, where it lands on, and kills, the Wicked Witch of the East. As Dorothy travels through Oz, rescuing the heartless Tin Man, the brainless Scarecrow and the Cowardly Lion, she might be thought to resemble Alice travelling through the Looking-Glass world in the company of the White Knight, the Sheep and the mournful Gnat.

But in truth Dorothy does not have much character – less than her three companions who nevertheless provide no niche for the reader's imagination to hang on to. Oz, with its four compass directions, two Wicked Witches and two Good Witches, and the Emerald City of Oz in the centre, feels like a construction, not like a dream. It has been said to be an allegory of utopian socialism, and it has been said to be an allegorised tract against the commodification of America. It is certainly about America, in a quite different way from the way that the Mowgli tales, Puck of Pook's Hill, and Kim are about the British empire. Baum was both a great storyteller and a writer with designs on his audience. I have read a very convincing case for the idea that the Yellow Brick Road and the silver shoes Dorothy takes from the dead witch are an allegory of the 19th-century disputes about bimetallism and the gold standard. Even the name Oz would stand for an ounce of free silver on the golden path to a free coinage. (The shoes were changed to ruby in the 1939 film.) Jack Zipes has argued convincingly that Baum's 14 novels about the land of Oz are a criticism of the America of his time, its machines, its commodities, its politics. Oz, with its kind witches and female powers, is the utopia that stands against, not for, the United States.

The way the story is told confirms the idea that it is firmly controlled by beliefs and meanings. Baum said that he was dispensing with the old world of fairy tales. This is from his 1900 introduction to The Wonderful Wizard of Oz:

Yet the old-time fairy tale, having served for generations, may now be classed as "historical" in the children's library; for the time has come for a series of newer "wonder tales" in which the stereotyped genie, dwarf and fairy are eliminated, together with all the horrible and blood-curdling incidents devised by their authors to point a fearsome moral to each tale. Modern education includes morality; therefore the modern child seeks only entertainment in its wonder-tales and gladly dispenses with all disagreeable incidents.

"Amerika, du hast es besser," Goethe wrote, comparing new, clean America to the old continent, with its decaying castles and grim tales. European readers may feel that there are things missing from Baum's imaginary world. He mediates this world to us in some ways similarly to the way in which Mrs Molesworth mediates the fairies and shadows of The Cuckoo Clock. As Zipes remarks, Baum's "own writing style and the governing style of [the good witches] Ozma and Glinda are strikingly similar: they are soothing, and attentive to the peculiar desires and needs of characters." Zipes sees the Oz books as examples of "psychological principles of object relations that are to guide parents in the nurturing of their children." Oddly, this does not lead to the invention of characters into whom the reader can insert his or her imagination. What is splendid about Oz is the detail of things – yellow bricks, emerald glasses, oilcans. Dorothy does good. ­Alice tries furiously to understand.

Mowgli and Kim, the lone children who inhabit Kip­ling's India are, on the other hand, sagacious, resourceful and brave. The worlds they inhabit are open to the imagination of the reader. I was amazed, on rereading the Jungle Books, just how much of the jungle and its people I had made up myself, events and places that were not to be found in the original tales. It was not exactly that I "was" Mowgli. I have a disproportionate resistance to the idea of "identifying" with anyone at all, ­fictive or real. Mowgli is alone in a world with its own strange laws and inhabitants, as Alice is alone. He needs to make sense of it, and fast, from the chattering Bandar-log to the swaying snakes. He is both self-sufficient and loved by creatures who are not his parents, or allegories of human family members, but talking beasts in a beasts' world. But as a reader one lives along with Mowgli – or for that matter with Rikki-Tikki-Tavi pursuing cobras through bathrooms. There is no one like Kipling for smells and sounds, and that peculiar placing of a clearing or a bungalow garden so that the reader knows that the world stretches away beyond what can be seen, equally full of interest, of excitement, of fear. I did not want Mowgli to go back to the humans. I cared as much and as little about his mother as he did, though he needed to save her from the nasty and stupid co-villagers. You are made to look out of Mowgli's eyes (though not exclusively); you cannot get inside Alice.

The other solitary boy I accompanied like a clinging shadow was Jim in Treasure Island. His is a first-person narrative, which is as often distancing as it is involving. But the smells, the fear, the effort, the attempt to read strange and dangerous faces, or deceptively mild ones, become part of one's own consciousness. The reader can walk in unexplored parts of Treasure Island, can imagine being marooned. Jim enters his story as his father dies and his world becomes precarious, like that of Mary in The Secret Garden. Jim's mother is there at the beginning, counting out no more than her due of gold coins from the dead pirate's hoard. The adventure story begins when Jim leaves home.

In British fairytales the human characters are often swept away to where the fairy folk live, down a tunnel, between the roots of trees. In George MacDonald's tales about Curdie, the princess and the goblins, Curdie is a miner, the goblins are under­ground and the princess makes a fearless journey to save Curdie. Alice goes down the rabbit hole, the Darling children find themselves in the Lost Boys' underground lair in Neverland. The other place where children between two kinds of reality tend to wander is along endless corridors of rooms with closed doors – Mary and Griselda do this, both looking for a way in. In Alice's adventures underground, as in The Cuckoo Clock, and, differently, in The Secret Garden, they find the way to places full of brightness and colour, into gardens. Where they come from is gloomily coloured, as they are themselves. Mary comes from India, which in Kipling's world is rich and bright, but in hers is desiccated and yellow – as she herself is sallow and yellow. Dorothy and her dog Toto are whirled from grey Kansas to the blue Munchkins, the yellow road, the emerald city (even if its brilliance is an illusion bestowed by emerald-coloured glasses). Mrs Molesworth writes of Griselda: "A little girl in a grey merino frock and grey beaver bonnet, grey tippet and grey gloves – all grey together, even to her eyes, all except her round rosy face and bright brown hair. Her name even was rather grey, for it was Griselda."

Alice peers through "a small passage, not much larger than a rat-hole" into "the loveliest garden you ever saw. How she longed to get out of that dark hall and wander about among those beds of bright flowers and those cool fountains, but she could not even get her head through the doorway."

Griselda, with the cuckoo, visits Butterfly Land, a garden world in which flowers of all imaginable and unimaginable colours are arranged in regular order, and where the butterflies are diligently collecting colours to paint the more shadowy flowers "down there" in Griselda's world. Mrs Molesworth steadily mixes the Protestant work ethic with the magical – the butterflies work to the point of exhaustion. In the real world of The Secret Garden Mary is shown the key to the walled garden, buried for 10 years, by a friendly robin, and restores the garden to life and colour as grey winter moves to spring, assisted by Dickon, a village boy like Puck or Pan, who has a following of wild creatures – squirrels, rook, rabbit. The "magic" in the garden also restores the imaginary invalid Colin to health and colour. I think the idea of what Morris called "a little garden-close / Set thick with lily and red rose" is a particularly English one. American children are made free by the prairie (or Central Park in magic forms) and Australian children discover the outback.

Imagined worlds are full of imaginary creatures. Real fairytales are full of talking beasts (horses, donkeys, pigs) and animal helpers (sturgeon, doves, foxes) who come and go as the plot needs them and then disappear. MacDonald's goblins are accompanied by all sorts of ugly and distorted beasts; Curdie in a later book has an army of them, including Lisa, a dog with elephant legs and shark's teeth, and the leg-serpent, who has a winged head, a long sinuous body, and four short legs near its tail. Gillian Beer has written about these in terms of Darwinian speculation about acquired characteristics. The creatures in the ­Alice books are talkative and argumentative. They have human characteristics but are not human. The White Rabbit is a rabbit in a waistcoat with a pocket watch, the Dormouse is a dormouse, the Monstrous Crow is a crow. Alice lumps both humans and animals together as "creatures" and thinks that they do go on talking so much. In The Wind in the Willows all the characters are creatures – badger, rat, mole, toad – and are simultaneously English bachelors who have not grown up, and boys seeing the countryside. Mole comes up from his own dark hole and sees the brilliance of the river bank and its ducks, or walks through the Wild Wood afraid of weasels and stoats. Most of all, in the Jungle Books, the creatures are characters and also creatures. The wolf pack hunts like a wolf pack, the snakes move like snakes.

Film productions of the Alice books, and much psychoanalytic commentary, tend to dwell on the frightening aspects of the incomprehensible creatures – the execution-obsessed Queen, the huge child in the tiny bedroom. Jan Švankmajer's surrealist 1988 film Alice takes place in a grim, dead house with peeling paint, menacing toothed beasts and threatening scissors and knives. It's a good film but it is not Alice who moves fearlessly through bright weather. Martin Gardner, editor of the splendid The Annotated Alice, notes that there are a series of jokes about death in the stories. The first is when Alice remarks "Why, I wouldn't say anything about it, even if I fell off the top of the house!" and the narrator adds wryly "Which was very likely true". But Alice is not thinking about death and neither does her reader. She is not afraid in the wood where all things lose their names – she goes on puzzling things out. Both Gardner, and Jonathan Miller in his remarks about his 1966 television film Alice in Wonderland, reject the insistent Freudian interpretations which start with holes and keys. Miller very successfully cast all the creatures as humans – weird versions of the Oxford dons and college porters the real Alice would have known. He has a wonderful cast of virtuoso actors – Peter Sellers as the King of Hearts, Peter Cook as the Mad Hatter, Michael Redgrave as the Caterpillar and, best of all, John Gielgud and Malcolm Muggeridge, at the sea's edge, dancing the lobster quadrille. His Alice, like all the acted Alices I have seen, is the wrong side of puberty and can look sulky as opposed to annoyed.

Fear goes with evil ­beings, and with dangerous landscapes. Blind Pew, and smiling, treacherous Long John Silver taught me much about fear, about the possibility of real danger. Kipling's jungle, of which Grahame's Wild Wood was an innocent relation, also taught me fear – as indeed did Beatrix Potter's Tom Kitten, lost in the tunnels of the chimney, rolled in pastry by a terrible rat. We need, we enjoy fear. Kipling has a wonderful tale in The Jungle Book – "How Fear Came" – and a poem I used to chant, "The Song of the Little Hunter", with its refrain "It is fear, O little Hunter, it is fear." Kipling knew, as MacDonald and Stevenson knew, the thrill of human fear in a landscape which is larger than human, full of darkness and dangerous creatures. Rereading now what I read as a frightened child in wartime what I feel is grief, grief for the lost jungles, the overrun oceans, the diminished woods.

The opposite of fear, in the Victorian and Edwardian tale, is cloying sentiment. Oddly, this does not harm the tale of Little Lord Fauntleroy, a child with an American mother called "Dearest" whose generosity and goodwill towards all the world convert his wicked, cynical grandfather, who keeps his mother at a distance in a dower house. Burnett writes with total conviction about this kind child, and takes the reader with her. But what are we to make of that disastrous work by Lewis Carroll himself, Sylvie and Bruno? The narrator, a man, slips in and out of his real life into the fairyland world of the sweet children, Sylvie and Bruno, which is full of sickly baby talk and bad jokes. As a child, I tried so hard to read it. I gave it every benefit of the doubt – this was the master of storytelling and humour – and even as a child I was embarrassed for him. Barrie's sentimental tales are more sinister. "The Little White Bird" was the story in which Peter Pan made his first appearance. It tells of Kensington Park, where babies fall out of their prams and no one notices, and dead babies become fairies. Peter Pan is no more than seven days old. The crusty bachelor finally manages to fulfil his dream of spending the night with a young boy whom he is looking after, in his bed. It is all about sweet innocence – like Sylvie and Bruno – and makes the reader more uneasy and anxious than that heavy failure.

The creatures in the Pooh stories are animated stuffed toys, who are entirely adequately represented by EH Shepard's drawings. The reading child is wiser and cleverer than all of them, and also wiser and cleverer than Christopher Robin. This is a tame, enjoyable, circumscribed wood, and maybe for that reason I don't too much mind seeing the Disney representations of it, though I've never watched the film through. In the 1970s Alison Lurie was writing about the Disneyfication of the American (and consequently the British) imagination. The old fairy stories, their power and their mystery, were, she said, being killed by saccharine twinkling princesses and sweetly comical dragons. The first such Disney film I ever saw was Snow White, which added considerably to my experience of wonderful fear and terror, even though its heroine was a doll. This, I have been told, was because it was made by German refugees who had a sense of the darkness of the old stories. The film Bambi diminished the sense of real forests and creatures I had found in the book. The unbearable thing was the filming of the Jungle Books. Disney cartoons use the proportions of human baby faces – those wide eyes, those chubby cheeks we respond to automatically. The black hunting panther, the terrible strong snake, the wolf pack and its howl, the cringing tiger became dolls and toys like Pooh, Piglet and Eeyore, and some crucial imaginative space was irretrievably lost.

Tim Burton has wisely solved the problem of Alice, girl actors and puberty by making her 19. Alice is both lucky and resilient when made into films. So much of the original is recitations and performances, which great actors can, and do, make new and startling. The space of its world is in the head, and can be done with sets and visual trickery. The version in my memory remains intact.

Alice in Wonderland opens nationwide on 5 March. The BFI Southbank Alice in Wonderland season runs from March 5 to 17.