Sometime in 1885 or 1886, Arthur Conan Doyle was doodling on a sheet of paper. He had the idea – inspired by Auguste Dupin, the sleuth who had solved Edgar Allan Poe's "The Murders in the Rue Morgue" – for a "consulting detective", who would use "the Rules of Evidence" to catch his man. But what would he be called? "Ormond Sacker"? "Sherrinford Holmes"?

Had he settled on either of these alternatives, the modern-day fanclubs for the great-grandfather of gumshoes might now style themselves "Sherrinfordians", "Sackerians" or "Ormondians". Instead, they are "Sherlockians" in the US and "Holmesians" in the UK, and, at a exhibition opening at the Museum of London on Friday, they will be able to peer through their magnifying glasses at that historic piece of paper.

Sherlock Holmes: The Man Who Never Lived And Will Never Die is the first major show dedicated to the great detective since a Holmes display graced the Festival of Britain in 1951. It's a winningly daft title: there are an infinite number of men who never lived and will never die, and a very large number of fictional creations of whom the same could also be said. But you can see what they are getting at.

It is apt that the show should take place at the Museum of London. Holmes occupied perhaps London's most famous imaginary address – 221B Baker Street – and Dr Watson wrote that his "knowledge of the byways of London was extraordinary". In the form of his "Baker Street Irregulars", he even employed a street-level spy-network of urchins. London is often described as another character in the stories.

But, as historian David Cannadine points out in a fine, sceptical essay in a new book accompanying the exhibition, Holmes's London is actually only sketchily imagined in the stories. Conan Doyle grew up in Edinburgh, was educated in Lancashire and Austria, and lived in central London for less than a year before moving first to South Norwood, then in short order to Hindhead in Surrey and later to Sussex. To move Holmes around the capital, Conan Doyle used contemporary street atlases and the London Post Office Directory – the closest thing to Google Maps at the time. And he made all sorts of mistakes.

It's true that when we think of Holmes – as well as funny hats, dressing-gowns, pipes, violins, scary dogs and "a 7% solution of cocaine" – we think of gaslight and gloaming, tendrils of fog, the impatient rap of cane on cobblestones, horses whinnying and hansoms clattering. But this is as much due to Basil Rathbone's set-dressers and the prose of Charles Dickens as to the prose of Conan Doyle. But that is the genius of the stories. And it isn't just with respect to London that Conan Doyle's creation proved porous to the imaginations of others.

That sort of porosity is the defining characteristic of myth – and Holmes did indeed almost instantly become a myth. He escaped the confines of his stories, just as he escaped his exasperated creator's attempt to kill him off. Indeed, many of his best known appurtenances are completely absent from those stories. As any fule kno, he never said "Elementary, my dear Watson". The magnifying glass is Conan Doyle's, but the deerstalker hat was a creation of the Strand magazine's illustrator Sidney Paget. As the film director Michael Powell observed, it was Paget's drawings, as "much as the text" that "created the immortal folk figure". Holmes even lives – which is truly the sign of cultural reach – in long-circulated jokes with punchlines such as "Alimentary, my dear Watson", "Sedimentary, my dear Watson" and "Lemon-entry, my dear Watson". The parodies – with titles such as "Detective Stories Gone Wrong: The Adventure of Sherlaw Kombs" – started to appear almost immediately.

Detail of a Sidney Paget illustration in Strand magazine for ‘The Adventure of the Silver Blaze’: Holmes gave me a sketch of the events. Illustration: Private collection /Alex Werner

Also, before fan fiction as we think of it now got under way, the Holmes stories spawned a strange academic version of fanfic: Holmesians taking a scholarly interest in the texts almost on the presumption that Holmes and Watson were real historical characters. One of my favourite literary endeavours is the scholarly edition of the stories prepared by Leslie S Klinger for Norton in 2005. The New Annotated Sherlock Holmes runs to nearly 2,000 coffee-table-sized pages and has a 70‑page bibliography of "selected sources" (eg "Guy, Patricia: 'Bacchus at Baker Street: Observations on the Bibulous Preferences of Mr Sherlock Holmes and His Contemporaries'").

It should be noted that Conan Doyle himself didn't sweat the details. Everything from the location of Watson's old war wound to his marital situation and the address of his consulting room was distinctly patchy. Characters' names are occasionally observed to change halfway through a story. Here, Holmes is a notorious practical joker; there, he is identified as having no sense of humour whatever. Here, we're told he's an early riser; there, a bastard for his lie-ins. The stories are hackwork of a very high order – which, oddly, makes them more rather than less fun to subject to the forensic scrutiny of the obsessive. Debates about their inconsistencies provide the space for elaborate and ingenious theories to blossom – just as they did when fans were encouraged to speculate on how the BBC's Sherlock faked his own death in a fall at the end of the second series.

Sherlock Holmes's forensic science utensils. Courtesy of the Museum of London

And so the exhibition seeks to give a sense not only of Holmes's origins but of the real-world milieu in which Conan Doyle set him and of his memetic spread through the culture. As well as manuscript pages from Poe's "The Murders in the Rue Morgue" and a full manuscript of Conan Doyle's The Adventure of the Empty House – the story that "resurrected" Holmes after his fatal tumble into the Reichenbach Falls – there are Paget illustrations (including an oil portrait of Conan Doyle not before seen in the UK), theatrical and movie posters and props, a considerable amount of late 19th-century London paraphernalia (maps, etchings, gelatin prints of locations from the stories), Victorian automata, instances of cutting-edge 19th-century tech, Turner's painting of the Reichenbach Falls, Jeremy Bentham's violin and a coat that has actually touched Benedict Cumberbatch.

It is possible to be tricked by that spread through the culture – by Holmes's literary descendants, the vast canon of detective stories that would not have been possible without him – into mistaking some of the essential features of the stories themselves. In 1928, the writer SS Van Dine published his influential 20 "commandments" for writing detective stories. First among them was the stipulation "The reader must have equal opportunity with the detective for solving the mystery." This is gestured at in Ronald Knox's own "Ten Commandments" for writing detective fiction, which forbids coincidence, "supernatural or preternatural agencies", the detective having "an unaccountable intuition which proves to be right", "hitherto undiscovered poisons", the sneaky use of identical twins and (more oddly) "Chinamen".

The basic idea that the story is a challenge to the reader, and a fair one, is the motor on which most golden age detective fiction runs – and it is a motor absent from the adventures of Sherlock Holmes. "The Adventure of the Speckled Band", for instance, offers the reader no serious means of guessing the outcome; which depends, incidentally, on the hitherto undiscovered poison of a non-existent snake called the "swamp adder". The "deductions" Holmes makes are seldom available to a reader to get ahead of. Holmes is, or might as well be, a magician. In this respect, the modern BBC TV adaptations – whose leaps of prestidigitation I've seen grumbled about – are in keeping with Conan Doyle's originals.

That, too, makes him suitable for myth. He's not the product, not any more, of a single author. And he's never going to be on the reader's level – nor that of his friend Dr Watson (who, as John le Carré has put it, "doesn't write to you" but "talks to you, with Edwardian courtesy, across a glowing fire"). Conan Doyle's consulting detective is, rehydrated by the imaginations of others, a chilly sort of god. And like all the best gods, he is – as the new exhibition's title indicates – both imaginary and immortal.

• Sherlock Holmes The Man Who Never Lived And Will Never Die runs from Friday until 12 April at the Museum of London, EC2.