One of the functions of fiction is to serve as a kind of tourism, either showing us places, situations and people that we might not otherwise reach or scrolling through snapshots of events or sensations that we remember. Crime stories rarely serve the latter purpose – most admirers of homicide novels will, thankfully, never become or even know a murder victim – but are a perfect illustration of the former.

Throughout its history, crime literature has operated as a sort of imaginative travel agency, taking customers across borders and introducing them to unknown cultures. The story commonly considered the birth of the whodunit – Edgar Allan Poe's "The Murders in the Rue Morgue" (1841) – was written by an American and set in Paris. Since then, the genre has regularly been a ticket for a Grand Tour.

Agatha Christie, an enthusiastic globe-trotter through her wealth and marriage to an archaeologist, sent Hercule Poirot on the Orient Express, Nile cruises and aeroplane journeys, depicting trips that the majority of her audience was unlikely ever to experience for real. Later in the 20th century, readers, listeners and viewers of detective tales learned about France from Simenon's Maigret and the Netherlands through Nicolas Freeling's Commissaris Van der Valk, who achieved the rare double of topping both the TV ratings lists (in the ITV series starring Barry Foster) and the pop charts, with the Simon Park Orchestra's recording of the theme tune, "Eye Level".

And, these days, Britons have a greater understanding of Scandinavian culture than ever before: not from exports such as Abba, Bjorn Borg, Volvo or Ikea, but through what was – at least until the recent apothesois of sado-masochistic soft porn – the biggest publishing phenomenon of the 21st century: the super-selling mystery stories of writers from Sweden (Stieg Larsson, Henning Mankell) and Norway (Jo Nesbø).

Retracing these journeys, I have made a 15-part series for BBC Radio 4, Foreign Bodies, which uses celebrated fictional detectives – from Christie's Poirot to Nesbø's Harry Hole – to explore the history of modern Europe. Cop novels are a useful tool for such a survey because the police procedural turns on detail. Novelists working in crime-free narratives have no need (and often no wish) to specify a character's job, clothes, income or family background. But because observation and evidence are crucial to the investigation of a crime – the motive for which will often rest on who someone was or what they possessed or desired – crime writers routinely provide a mass of social detail: menus, train timetables, fashion labels, shops, newspaper stories. As a result, good crime novels become a case-file of their times. The introduction of the welfare system and unemployment benefit, for example, can be traced through the comments of posh employers in Christie's mysteries. And reporters preparing to cover the impending referendum on Scottish independence would be well advised to read Ian Rankin's DCI Rebus books, which systematically depict the country's re-examination of its identity over the last 25 years, with one book – Set in Darkness (2000) – even involving the discovery of a corpse in the foundations of the Scottish parliament building.

In the same way, future historians considering why Sweden holds the improbable distinction of being the only western democracy to have both its prime minister and foreign minister assassinated in modern times – or why a racist gunman killed 77 people in Norway in 2011 – will find clues to the forces behind those events in crime novels written at least a decade earlier.

Crime fiction is a magnifying glass that frequently reveals the fingerprints of history before they become visible to politicans or journalists. And – as in a forensic investigation – separate pieces of evidence can begin to reveal patterns.

On Crimewatch UK, during the update section just after the news in which the detectives discuss calls that have come in from the public, lead investigators will often comment, with a note of satisfaction, that "certain names have come up several times already". Weight of recognition, cross-referencing of mentions, is frequently a crucial clue in detection. And, in a more benevolent sense, it was striking how, while following the trail of crime novels written from before the second world war to the present day, the same names – of influential authors and characters – kept cropping up.

As keen readers in the field might guess, the undisputed godfathers of the genre remain Sir Arthur Conan Doyle (1859-1930) and Sherlock Holmes, who lived in print from 1887 to 1923, although he carries on immortally in all entertainment forms. So long and so strong is the shadow of Holmes that anyone subsequently creating a detective in any culture has had to make a deliberate gesture of homage or avoidance to the resident of 221B Baker Street.

For example, it is my strong suspicion that the reason Hercule Poirot (print-dates 1920-75) is Belgian is that, if Christie (1890-1976) had made him English, the detective's characteristics – intuitive, aloof, fastidious about couture and cuisine – would have made him too transparently a Holmes clone. The most dramatised detective after Holmes and Poirot, Commissaire Jules Maigret (1931-72), is again distanced from the template by his Parisian location, but he too has certain Holmesian aspects (hyper-intelligence, a pipe) that feel like deliberate nods from his creator, the officially Belgian but temperamentally French Georges Simenon (1903-89).

With remarkable consistency across generations and nations, Holmes is the genre's homepage. The tendency of fictional detectives to be more cerebral and sensitive than their real-life counterparts – PD James's Adam Dalgliesh writes poetry, Ruth Rendell's Reg Wexford was a probably rare Guardian-reading liberal in the 1960s force – follows Conan Doyle's model of the reflective detective, as does the latest top British cop: Peter James's thoughtful, haunted DCI Roy Grace.

The Czechoslovakian writer Josef Škvorecký (1924-2012) created, in Inspector Boruvka of the Prague Homicide Bureau, a policeman profoundly indebted to Holmes in both hyper-intelligent rationalisation of crimes and near-clinical melancholy. And the newest super-sleuth in publishing – Nesbø's Norwegian private eye, Harry Hole – also allusively combines addiction with an almost supernatural ability to see into the minds of criminals.

So pervasive is the post-Holmes type that only significant distinctions of background or gender can avoid the influence. Rankin's impulsive, earthy, working-class Scottish DCI Rebus seems deliberately to depart from the looming English examples. And Lynda La Plante's DCI Jane Tennison, who solved seven murder cases on television between 1991 and 2006, was almost as revolutionary as Sherlock in offering an alternative female model, which has been continued and extended in print by writers including Val McDermid and Denise Mina. However, because Conan Doyle is to some extent an invisible author – most of the Holmes stories employ the voice of Dr Watson and take the form of his report on the case – he is not the author with most influence on prose tone and structure. In that respect, my inquiries revealed, the biggest influence in European crime fiction is Simenon.

Andrea Camilleri's Inspector Montalbano (played by Luca Zingaretti in the TV series) questions what it means to be a good policeman. Photograph: BBC/RAI Radiotelevisione Italiana

In Rome, Andrea Camilleri – creator of the Sicilian policeman Inspector Montalbano – pointed out to me the complete set of Maigret books on his shelves. In Berlin, one of the leading German crime-writers, Jakob Arjouni, also kept a complete Simenon close to his desk. PD James cites Simenon as a master as well, confirming a literary afterlife that perhaps validates the view of André Gide that the Belgian writer should have won the Nobel prize for literature.

This strong sense of tradition and succession in crime fiction was underlined by the almost universal tendency of leading crime novelists to acknowledge predecessors as inspirations. For example, Mankell admitted that his Kurt Wallander – a melancholy Swedish policeman whose cases expose changes in Scandinavian society – could never have existed without the example of Martin Beck, a depressive, historically sensitive cop who featured in the novels of a married couple of former journalists, Maj Sjöwall and Per Wahlöö, whose 10 Beck books published between 1965 and 1975 are being dramatised by Radio 4 as part of this exploration of European crime fiction. Nesbø argues that Beck is the source of the now dominant wave of Scandinavian crime stories: a Nordic Holmes.

In describing the main remit of my inquiry as postwar crime fiction, I meant the second world war. And the conflict of 1939-45 has an understandably large presence in books written from the differing perspectives of Britain, France, Holland, Germany and Italy. More surprising, though, was the dawning realisation that even books set beyond the reach of that period seemed to have a significant relation with some other military standoff, as if postwar wounds were a natural driving force of the murder novel.

The Vietnam war stalks the Martin Beck sequence: his creators met at a protest march against US involvement in south-east Asia. There are long echoes of that radicalising issue in Nesbø's novels as well. Meanwhile, through his books about the best man in the Prague Homicide Bureau, Škvorecký animates two key eastern European experiences of the cold war: occupation and exile. The Mournful Demeanour of Lieutenant Boruvka, written in 1966 in Prague under censorship from the Russian-backed puppet government, can only express dissidence through code and nudges. But, after the author gained asylum in Canada following the Soviet invasion of 1968, The End of Lieutenant Boruvka (1975) and The Return of Lieutenant Boruvka (1980) provide a compelling account of the moral horror and bureaucratic comedy of life under communism.

In a similar way, Arjouni's character of Kemal Kayankaya – a private eye born in Germany to a Turkish immigrant family – explores the consequences for Europe of the collapse of the Soviet empire, the wars in the former Yugoslavia and the reunification of Germany. From Happy Birthday, Turk! (1980) to Brother Kemal (to be published in English in 2013), in which Kayankaya is hired to protect a writer who has offended Islamist groups, Arjouni uses crimes to explore issues – of immigration, nationalism and religious sensitivity – that dominate contemporary European politics.

In the work of Spain's foremost author in the form – Manuel Vázquez Montalbán (1939-2003) – the conflict that underlies the writing is the Spanish civil war, or, at least, the dictatorship of General Franco that followed and the subsequent transition to a constitutional monarchy, with King Juan Carlos I as a rare example of a monarch as a post-revolutionary figure. Montalbán (after whom Camilleri's Inspector Montalbano is named in homage) employs his Barcelona private eye, Pepe Carvalho, to interrogate this complex political situation. Montalbán's work is an exemplar of how crime novels can be used to analyse shifts in society: An Olympic Death, published just after the 1992 Barcelona games, makes fascinating reading in a London also struggling with the cost and legacy of hosting the event.

Inevitably, though, it is scar tissue from the great global battles of the 20th century that runs through European crime fiction. Both Maigret and Poirot are war veterans: David Suchet laments that the limp from the Belgian's wound is the only characteristic he has failed to incorporate in his ITV portrayal. In the Van der Valk stories, on both page and screen, it was common for the solution to lie in whether victims or suspects had been collaborators or resistance fighters during the Nazi occupation of Holland.

And, even though Nesbø was not born until 1960, his books fascinatingly illuminate a specifically Scandinavian experience of the second world war. This is partly because of the writer's own personal legacy – his mother was in the resistance, while his father was among the Norwegians who fought with the Germans – but also because Norway has a literal inheritance from the period. As Scandinavians embodied the physical ideal of Nazi eugenicists, citizens were enlisted, during the occupation, in a breeding programme involving German officers, whose descendants remain in the population today. This dark history is threaded through the Harry Hole novels, particularly The Devil's Star (2005). In retrospect, we can see that the books also chart the rise of modern Norwegian neo-Nazism, a psychopathic disciple of which, Anders Behring Breivik, murdered 77 people in Oslo and on Utøya island last year. While journalism explored these tensions after the event, Scandinavian crime fiction – as the genre often does – sensed the undercurrents before the massacre happened.

Admittedly, there is one large and frustrating gap in the form's record of the causes and consequences of the second world war. Bernhard Schlink, who wrote a number of detective novels in the 1980s before becoming better known for literary fiction such as The Reader, acknowledges that for decades German authors were reluctant to engage with their nation's past. My suspicion is that mystery stories were a particular victim of this self-censorship because the classic structure of the murder puzzle – in which the guilt of the past is exposed and secrets are revealed - was always likely to lead, in Germany, to the villains of the Hitler era. The continuing sensitivity of the subject was shown this year when Ferdinand von Schirach – whose grandfather was head of the Hitler Youth – achieved a bestseller but also triggered controversy with The Collini Case, a legal thriller that deals with the continuing taboo of the infiltration of the postwar German political and judicial systems by former Nazis.

Because of the belated and apprehensive literary response to the war in the defeated aggressor, the greatest German-language crime stories of the 20th century were written by a non-German. Friedrich Dürrenmatt (1921-90) was a Swiss polymath who worked as a playwright (The Visit, The Physicists), artist and essayist, but also wrote brilliant cop novels that explore the postwar guilt of Germany and Switzerland, whose official stance of political neutrality Dürrenmatt regarded as a lie.

Jack Nicholson as the compromised cop in The Pledge. Photograph: Warner Bros

Through the character of Inspector Bärlach, a Bern-based policeman who was seconded to Germany in the early 1930s but left after a row with a Hitler official, Dürrenmatt, in The Judge and His Hangman (1950) and Suspicion (1951), deals with such subjects as Swiss complicity in harbouring former Nazis. It is in the work of Dürrenmatt that the crime story most fulfils its potential as an instrument for moral exploration. In The Pledge (1958), provocatively subtitled "Requiem for the Detective Novel", a retired homicide detective shockingly uses a young girl as bait in the hope of catching a sex-killer who has eluded him. In an Americanised but still properly disturbing version, The Pledge was impresssively filmed by Sean Penn in 2001, with Jack Nicholson as the compromised cop.

During months of interviews, one comment affected my thinking about the genre more than any other. The Spanish writer Antonio Hill – who has just started a Barcelona-based series with The Summer of Dead Toys – told me that, on a recent trip to Mexico, his hosts had expressed astonishment at his profession. "Why the hell," they asked, "would you want to write books about policemen?" Mexicans could not envisage a cop as a hero.

The implication of this anecdote – that crime fiction depends on readers' respect for the investigator – poses a challenge to mainstream British crime fiction, in which there is an overwhelming assumption that justice will ultimately be done. With very rare exceptions – in one of PD James's novels, Dalgliesh is forced to accept that the real villain has evaded blame – the crime is correctly and satisfyingly solved. And yet, from the Birmingham Six to Hillsborough, via recent allegations of police complicity with tabloid journalists and earlier failures to investigate the paedophilia of Jimmy Savile, there are frequent worrying suggestions that the British police have been less reliably straight than their counterparts in fiction.

Mexicans sceptical about this kind of literature, though, should note Italian crime fiction, which pointedly accommodates ambiguity about the possibility of resolution and the role of the investigator. Leonardo Sciascia (1921-89), identified as a past master by contemporary authors almost as often as Simenon, openly showed an Italian society in which the power of the Mafia is so great that the judicial system judges it unwise to identify the true culprits. In Equal Danger (1971), Inspector Rogas, a rural 'tec looking into murders in the legal profession, soon realises that his police and political bosses do not want him to uncover the truth. That novel, and The Day of the Owl (1961), were landmark books in making Cosa Nostra a legitimate subject for fiction.

Andrea Camilleri – who, like Sciascia, comes from the Mafia heartland of Sicily – has continued his predecessor's project of dramatising the overlap between the political and gangster establishments. Inspector Montalbano directly addresses, in anguished inner monologue, the question of what it means to be a good policeman in a culture where it can be unwelcome – or even dangerous – to crack a case. The fine British writer Michael Dibdin (1947-2007), in his 11 books about the Venetian-born Inspector Zen, borrowed from Sciascia a very non-English scepticism about the good faith of police operations.

The pressure to ignore the real perpetrator, or to pin the crime on a false suspect, is even greater for characters who serve as police officers in a police state. The Russian writer Boris Akunin addresses this dilemma – albeit through the distancing device of historical parallel – in his series about a 19th-century police officer, Erast Fandorin. But it was Škvorecký who, from his North American exile, most eloquently expressed the dilemma of the investigator encouraged to turn a blind eye. Inspector Boruvka's problem in Soviet-controlled Czechoslovakia, he wrote, was that "the whole country was a crime scene" in which mass murders were regularly carried out by the government. From his reading of Conan Doyle and others, Škvorecký understood that the classic homicide puzzle depends on violent death being an exceptional event. That is why the English genre – from Christie to James and Rendell – has often involved bodies being stumbled on in rural communities, guaranteeing a dissonance between order and disorder.

Tom Bradby's Shadow Dancer with (left to right) Domhnall Gleeson, Andrea Riseborough and Brid Brennan. Photograph: Jonathan Hession

Certainly, another place that was a permanent crime scene for decades – Northern Ireland – has been slow to embrace the tradition. Only now, after years of ceasefire and peace process, is Northern Irish crime fiction flourishing through such writers as Stuart Neville and Tom Bradby. Jason Webster points out that Spain's equivalent of the IRA, the Basque separatist terrorists ETA, who agreed a ceasefire only very recently, has yet to make a significant appearance in Spanish crime fiction. The cop novel seems to require chaos recollected from relative stability.

It's notable, though, that even in settings where a redemptive ending is unlikely, the central investigator is invariably on the side of right. However pressured or frightened Boruvka, Rogas, Montalbano or Zen may be, they at least attempt to do the right thing. Even at its most sophisticated, the genre seems to reflect a belief that order will be restored.

Among Sherlock Holmes's many profound influences on the genre is his status as a dire warning to authors of the risks of killing off a sleuth beloved by the public. Conan Doyle's medically unrealistic and narratively ridiculous resurrection of Holmes after killing him at the Reichenbach Falls has become a cautionary tale for crime novelists in much the way that makers of popular television are haunted by two notorious series-weakening links that also, curiously, involved water: Bobby Ewing coming out of the shower alive a year after dying in Dallas (his wife had dreamed his death!) and the Fonz raising his surfboard over a killer fish in Happy Days, leading to "jumping the shark" becoming the expression for a show that jettisons credibility.

True to his cussed literary sensitivity, Nicolas Freeling believed that he could jump the Reichenbach Falls. In A Long Silence (1972), Van der Valk goes for an evening stroll on a rainy Dutch street and is killed in a hit-and-run related to the case he is working on. A shocking passage even when read in the knowledge of its outcome, it is one of Freeling's best pieces of writing (the critic Grey Gowrie describes Freeling as one of the finest writers of atmospheric weather) but it had a calamitous effect on his career. His readership, like the crazed fan in Stephen King's Misery, rebelled and refused to warm to his replacement franchise: a series featuring a French investigator, Henri Castang. In an emergency manoeuvre, Freeling was persuaded to turn to his dead detective's widow, Arlette, as a central character in a new Van der Valk series, but the audience would not be appeased.

Conan Doyle and Freeling have the effect of a siren blaring in the head of any crime writer who, bored with a hero, considers sending them to Switzerland either literally (the Reichenbach Falls) or metaphorically, now that Zurich is code for euthanasia. Although, strangely enough, it is a Swiss detective who dies most decisively and irretrievably: almost the first thing we learn about Inspector Barlach of the Bern Police is that he has terminal cancer, which is why there are only two books about him. Killing a cerebral investigator in a Swiss canton may be another of Dürrenmatt's dark jokes.

In the modern publishing world, with marketing managers craving a new title in a bestselling series every Christmas for as many years as possible, authors have to make a formal decision about the longevity of their cops. PD James told me that she could not bear to kill off Dalgliesh, because it would feel like writing her own death, although she declared the end of the series with The Private Patient (2006). That same year, Rankin retired DCI John Rebus, but has brought him back to investigate a cold case (in line with realistic police procedure) in this autumn's Standing in Another Man's Grave, having admitted to missing him. Mankell gave Wallander Alzheimer's disease in a book published three years ago, which means the detective could theoretically return but not practically, thereby reducing Mankell's risk of suffering the misery of having his ankles broken by a furious enthusiast holding him hostage in a snowy cabin. Camilleri told me that a final Montalbano novel was written out of sequence and locked in a safe at his publishers (as Christie did with the Poirot coda, Curtain). Miming a waterfall with his hands, he joked that he has made it impossible for his detective to be resurrected.

At the Crime Writing Festival in Harrogate this year, Jo Nesbø, currently the world's bestselling crime writer, admitted that he knows exactly how many Harry Hole novels there will be. The front row, containing staff from his publisher, leaned forward nervously, but Nesbø refused to disclose the number. A keen crime-reader I know believes that it will be 10: the number of career cases investigated by the godfather of Scandinavian detective fiction, Martin Beck, and the number of books to which Stieg Larsson intended his Millennium sequence to stretch until his early death confined Lisbeth Salander to a trilogy.

Another Stockholm phenomenon – the Swedish Academy, which awards the Nobel prize for literature – ignored Gide's suggestion that the honour should go to Simenon. And such is the continuing snobbery against the genre that the Belgian's employment of crime fiction may have been held against him, as it may also have hobbled Dürrenmatt and Škvorecký, equally worthy candidates for the range of their writing. But, though sniffed at by literary history, crime writing, from Christie to Nesbø, has an enviable record of capturing the history of our times.

• Foreign Bodies runs on weekdays until 2 November at 1.45pm on BBC Radio 4. The Martin Beck Killings begins on 27 October at 2.30pm on BBC Radio 4.