Alex Salmond and Jeremy Corbyn may seem strange political bedfellows. But the movements with which each is associated have something in common. Each is sustained in part by powerful myths, turbo-charged by social media, of betrayal and conspiracy. If things go right for their movements, they say the people have spoken. But if things go wrong, their supporters’ first response is too often to cry foul.

For some, the clincher was that Leslie Evans is married to a former head of MI5. She isn't

It is clear that the allegations of sexual impropriety against Scotland’s former first minister, and Salmond’s decision to quit the Scottish National party on Wednesday night to clear his name, will have political consequences. Whatever the truth of the allegations, and whatever the outcome of the investigation by Police Scotland, there will be a significant public impact. The future of the SNP, which has dominated Scottish politics for more than a decade, may even rest on the outcome of Salmond’s potentially career-defining argument with Nicola Sturgeon’s government.

The reaction of many Scottish nationalists, especially on social media, has been all too predictable. Faced with an uncomfortable event, several cyber-nats have claimed that the allegations, and the way they became public, were all a unionist plot orchestrated by MI5 to destabilise the nationalist cause, in the interests of the UK state. For some, the clincher was that Leslie Evans, the Scottish government’s senior civil servant in charge of the preliminary investigation into the allegations, is married to a former head of MI5, Jonathan Evans.

Except that she isn’t. The target of so much current nationalist ire is in fact married to Derek McVay, once of the Edinburgh punk band the Visitors, who runs a music business called Del Boy International. What is more, McVay is now an active and prominent member of the SNP’s own Edinburgh Central branch. So it’s just possible that in her handling of the allegations Evans was simply doing her job, and the deep state, if it exists, has nothing to do with it.

Now consider Corbyn’s Labour party. As part of The World Transformed, the Momentum-led event that runs parallel to the Labour conference in Liverpool next month, there will be an event titled A Very British Coup: Wargaming a Radical Government. As the title implies, this is a game based on Chris Mullin’s clever 1982 novel of the same name, in which a leftwing Labour leader becomes prime minister and is brought down by a combination of media barons and Labour rightwingers, in cahoots with MI5 and the CIA.

The promotional material for the Liverpool wargame is certainly enticing – at least for anyone masochistic enough to be steeped in Labour politics of the Tony Benn era, as Corbyn himself is. Fifty players will take on the roles of “the different factions of the 1980s Labour party”. They “must compete and collaborate” to ensure their policies are prioritised by the new Labour government. Meanwhile, other participants are playing “the malign forces of the deep state whose task is to frustrate and sabotage the realisation of Labour’s socialist programme”.

Writing in the New Statesman, the columnist Paul Mason admitted that the Liverpool wargame might be fun, while dismissing it otherwise as pointless. Mason believes that 30 years of free-market economics have led to the strengthening of the rule of law and a state that “operates consciously within legal checks and balances”. To compare the behaviour of the state in the Mullin era with the behaviour of the state today is simply “the stuff of fantasy”.

But it’s a fantasy that simply does not go away. One of the reasons is Labour’s history, which is studded with periods and events in which the security services and the political parts of the police force either played, or were alleged to have played, a decisively anti-Labour role.

No event in that saga has more staying power in the Labour mind than the Zinoviev letter of 1924. This forged letter, purporting to come from the head of the Communist International in Moscow, urged British communists to give militant support to the plan of the first Labour government to recognise the Soviet Union, and to set up cells in Britain’s armed forces. Probably fed by MI6 officers to the Daily Mail, the letter was published at the start of a general election campaign in which Ramsay MacDonald’s Labour was trounced by the Conservatives.

Grigory Zinoviev, the Russian communist who, MI6 falsely claimed, was in cahoots with the Labour party. Photograph: History Archive/Rex/Shutterstock

Ever since, the Zinoviev letter has been, as the title of a new book by the former Foreign Office historian Gill Bennett has it, “the conspiracy that never dies”. There were attempts to get to the bottom of the affair in the 1960s, which may have contributed to the growing suspicions of the Labour leader, Harold Wilson, about MI6’s attitude to him and his government. As recently as 1998, the then Labour foreign secretary, Robin Cook – who had been a prominent critic of the police special branch when he was a backbencher in the 1970s – set up a review of the case .

Bennett wrote that review. Like most historians, she argues that the Zinoviev letter did not cost Labour the 1924 election. But the Labour fear that it did lives on nevertheless. This enduring belief – to which the conspiracy theories that are so rife in social media have given fresh energy – is one of the things that gives permission to radical movements to imagine that they are faced with a ruthless and obdurate deep-state enemy that is dedicated to frustrating their policies.

It would be naive to dismiss this fear entirely. But Mason is right that the much-mythologised deep state now operates in a more constrained manner than it did in the 1980s and certainly the 1920s. Radical movements love to think that the only reason their inherently virtuous projects can fail is because conspiracies, faintheartedness or betrayals have brought them down. The reality is that they have made mistakes, or their projects are not so virtuous after all.

Blaming it for your cause’s defeats – especially when the blame starts before even getting into power – is a sign of your cause’s failings, not the wickedness of the deep state. Parties must own their failures as well as their successes.

• Martin Kettle is a Guardian columnist