Defiant … a detail from a 1930s cartoon by EO Plauen, who killed himself rather than be tried by the Nazis.

Hitler and Goering are on the radio tower in Berlin, looking at the crowds below. Hitler wants to do something to put a smile on Berliners' faces. So Goering says: "Why don't you jump?"

It is not the funniest joke, but a German woman, Marianne K, who told it at her workplace during the war was reported to the authorities, and executed as a result. Film-maker and author Rudolph Herzog, son of the German director Werner Herzog, includes the anecdote in his book Dead Funny: Humour in Hitler's Germany, as well as the court documents relating to her death. Published in the UK next month, the book originated with Herzog's documentary on the same subject, Ve Have Vays of Making You Laugh.

Herzog's thesis is that, during the Third Reich, Germans relished jokes about their leaders. Throughout Hitler's 12 years in power, there were plenty of caustic gags doing the rounds – about Dr Goebbels's club foot, or Hitler's limp Nazi salute, which made him look like a waiter carrying a tray, or the widely held suspicion that Goering wore his medals in the bath. "These jokes were mass phenomena," Herzog says, "partly because political humour for some reason thrives under dictatorship."

It was also Herzog's own way of addressing the family history. "Except for my grandfather on my mother's side, all of my grandparents were staunch Nazis," he says. "On my father's side, [they were] even active in a way. The book is my way of breaking it down." He says that many were sceptical about the project, worrying that it would trivialise its subject matter: "I wasn't sure if the Germans would stomach it, but they did . . . I think every generation of Germans has to break it down for themselves in some way."

Seen at a distance of 70 years, these jokes can appear tasteless and feeble. Herzog argues that they offer a telling insight into "what preoccupied and moved Hitler's 'racial community'." They also reveal a tension. One of the most commonplace defences offered on behalf of the German people during the Hitler years was that they didn't know what their leaders were doing. But, as Herzog points out, the humour was often very pointed and very informed.

"One thing they [the Germans] knew – and they were in denial about it after the war, the whole generation – was the camps. There are numerous jokes about the camps," he says. "If they knew what was going on, why didn't they act? That's a very loaded question."

The German people were aware that the authorities would arrest and even execute anyone who ridiculed them too openly. Herzog tells the cautionary tale of Joseph Müller, a Catholic priest in a small parish in northern Germany, who, late in the war, recounted a shaggy dog story about a wounded soldier to an ailing old man. "He [the soldier] is dying and they ask him: 'Do you have a last wish?' He says: 'Well, I'd like to see the people I am dying for.' They bring a picture of Hitler and put it on his right and one of Goebbels and put it on his left. The man says, 'Now I am dying like Jesus Christ, between two criminals.'"

The old man's son, a staunch Nazi, reported the priest's joke to the party. Eventually, the priest was condemned to death by the People's Court for "undermining defensive strength". "In a way, it's not the joke that kills you. It's who you are," Herzog says. "The priest had already said things against the regime, and they didn't like priests in the first place."

Ask him whether he shares his father's ferocious, drag-a-ship-over-a-mountain drive, and Herzog parries the question. But writing Dead Funny was clearly a great challenge. "The film and the book – that's the better part of more than two years of my life. You need a certain amount of drive to do that to yourself, because it's not fun. It involves a certain amount of humour, but also digging into the nastiest things you could imagine. The Third Reich was just so horrendous. Having that in your head day after day is awful."