The Conservative Party might be ungovernable. It certainly refuses to be governed by David Cameron. Ukip has provoked delirium among some Tories, who seem to believe that the formula for success can be pilfered from a band of electoral brigands that mobilises nostalgic fantasies about the past to wage war on the present.

Most astonishing is Cameron’s persistence in thinking that this tendency can be appeased when the evidence proves it cannot. The Prime Minister’s latest concession – a parliamentary bill underpinning a pledge of a referendum on European Union membership – is an abdication of command painted in colours of incompetence. It confirms that what Cameron says he believes today is no guide to what he will believe tomorrow.

Behind the tussle over parliamentary procedure is an irresolvable tension. Cameron does not want to take Britain out of the EU; a large part of his party wants nothing more. This makes it inevitable that the Tories will ponder a change of leadership, periodically in public and almost constantly in private. That isn’t to say that Cameron will be ejected before the next election – enough Tory MPs know that a sloppily executed regicide would all but guarantee defeat at the next election. So the incumbent will probably be allowed a shot at victory in 2015.

By “victory”, the Tories mean securing a decent majority in parliament. Their reaction to power-sharing with the Lib Dems shows that they regard securing the biggest number of seats in a hung parliament as a failure, even though opinion polls suggest that this is the best result they can now hope for. If Cameron finds himself running a minority government or another coalition – or even if he scrapes through with a tiny majority – he will be destroyed by the referendum he has promised (his renegotiation plan dictates that he campaign for an “in” vote).

That dynamic explains declarations by senior Tories of their potential readiness to vote “out”. It is the sine qua non of advancement in the party. Two such interventions stand out as beacons of ambition: one by Boris Johnson and the other by Michael Gove. In a column in the Daily Telegraph, camouflaged with support for Cameron’s policy of renegotiating the terms of EU membership, the Mayor of London rehearsed the arguments for leaving in a manner that left no doubt that he is amenable to the idea.

Johnson’s casual Euroscepticism is not the reason he is toasted as the king over the water by many Tories but Ukip’s rise has nonetheless enhanced that status. The colourful persona that is “Boris” – unusual in being on firstname terms with the electorate – is the only figure who can match Nigel Farage in the effortless bonhomie that passes as distinction from conventional politics. And Boris’s appeal has been successfully tested on a majority Labour constituency – the capital. As one Tory junior minister put it to me recently: “If Cameron loses, the leadership is Boris’s for the taking. The party will be so desperate for someone who looks like a winner.”

One hurdle is that Johnson would need a seat in parliament but this, his allies say, can be arranged by the timely retirement of a friendly backbencher with a safe seat. Johnson’s lack of a base in the parliamentary party is also an obstacle but here his cheerleaders point out that their man doesn’t need to win a ballot of MPs. He just needs to come in the top two, at which point, under party rules, the choice passes to ordinary Tory members. In that constituency, Boris is unbeatable.

The more substantial concern about Johnson is his perceived lack of seriousness. There are concerns inside the Tory party and beyond that Boris is a character who only wins applause on the relatively inconsequential stage of City Hall. It might seem a dangerous proposition in a potential prime minister. Johnson’s critics raise the chilling prospect of a clumsy clown finger on the nuclear button. The capacity to rival Farage, they say, is misleading because the Ukip leader’s main function in politics is mischief. No one imagines him in Downing Street.

By contrast, gravitas and intellectual rigour are what distinguish Gove’s ambitions. The Education Secretary’s recent comments on the BBC’s The Andrew Marr Show to the effect that he would vote to quit the EU if a referendum were held today must be interpreted as positioning within the Tory party. A performer of Gove’s fluency could easily have deflected the question as a hypothetical irrelevance, since endorsement of the status quo isn’t government policy. Instead, Gove flaunted his ease in discussing the theoretical possibility of quitting the EU. Anti-Brussels hardliners on the back benches see that as a step on the road to embracing exit as a goal.

Gove’s appeal to Tories is almost the opposite of Johnson’s. He has no aura of massmarket celebrity but is admired in the party for his fixedness of purpose and executive effectiveness. He has turned the Department for Education into an independent citadel. His coterie of advisers avoid conflict with No 10 but hardly disguises their “Team Gove” loyalties. The zeal behind the push to convert local-authority schools to academies, found new free schools and promote pious cultural conservatism in the curriculum has stunned Labour, infuriated teaching unions and alienated civil servants. Those things count as triumphs among Conservatives who crave offensive action against what they see as a lefty bureaucratic establishment blocking revolutionary change.

Gove is feted as the antidote to Whitehall inertia, which is believed to have suffocated Downing Street. There are two problems with his potential leadership of the party. First, his erudite fluency and distilled ideology, which can count as assets in the rarefied confines of Westminster, seem downright odd anywhere else. On the left, he is decried as a maniac, which limits his appeal to swing voters. Second, he says he doesn’t want to be prime minister. Well, they all say that, don’t they? Perhaps, but Gove has equivocated less than most. He once said: “I know what it takes to be in that job and I just know that I don’t have it.”

Many of the Education Secretary’s allies believe him. He exhibits, they say, those rare qualities in a politician – awareness of limitations and realism about a lack of popular appeal. Or, as someone who has worked closely with Gove once put it to me: “He knows he’s too Marmitey” – savoury nourishment to some, vile to others, with few in between.

Renouncing a claim to the crown does not necessarily mean denying an appetite for power. Nor is it automatically the case that two people with voracious ambition must be rivals. George Osborne and Cameron came to a sensible understanding about which of them was the better candidate for prime minister. The other one got a job that is hardly less powerful.

Might such an arrangement be feasible between Johnson and Gove? The prospect is whispered around Tory circles but so are all sorts of permutations springing from the vanity of ministerial also-rans. The Defence Secretary, Philip Hammond, has been burnishing his Eurosceptic credentials. Ther - esaMay, the Home Secretary, is busily punctual with populist gestures on crime and immigration.

Yet the prospect of a Johnson-Gove joint ticket is more plausible than most war-gaming scenarios in a post-Dave era. The two men are friends. They are also more ideologically aligned than is often recognised. They combine easy acceptance of the liberal social mores of 21st-century Britain with Thatcher - ite economics and horror of “Brussels bureaucracy”. They share a patrician streak that borders on fogeyish, which means they can be as keen on promoting Latin teaching as they are supportive of gay marriage.

There is also a discreet policy collaboration between the two men. City Hall has no formal mandate over school policy but Johnson has set up a special unit that promotes the Education Secretary’s agenda in the capital. Properties owned by the Greater London Authority are being audited with a view for possible use as free school sites. The Mayor has also secured £20m in funding from the Department for Education budget for a “London Schools Excellence Fund”. This municipal sideline is run for Johnson by the deputy mayor Munira Mirza, who is close to Gove.

Crucially, Boris spares Gove from his vendetta against Cameron and Osborne, whom he considers political peers – to the extent that they were all elected to parliament in 2001 – and intellectual inferiors.

Johnson crashed out of the race for national office when he was forced to quit Michael Howard’s shadow frontbench team in 2004 over his mishandling of a sex scandal. Osborne and Cameron then enjoyed accelerated promotion as Howard’s protégés. Gove only entered parliament in 2005 and so, despite partial inclusion in Cameron’s governing clique, is not covered by Boris’s ferocious “class of 2001” envy. Inside City Hall, Gove’s agenda is said to be the only substantial part of the coalition programme for which Johnson can muster any open admiration.

None of this is proof of an emerging alliance. However, the conditions for such a partnership plainly exist and both men are astute enough to have clocked its potential. (It is worth noting at this point that both men have also stayed studiously on the antiintervention side of the Leveson debate over press regulation, a position that charms the Tory-leaning press. Both have open channels of communication with Rupert Murdoch.)

A Johnson-Gove collaboration would not satisfy every taste in the Tory party – no candidacy could manage that feat. It is still probably the best available compromise between the metropolitan, modernising impulse –which drove Cameron’s efforts in opposition to render the party electable – and more orthodox Conservatism.

Gove is seen by many MPs from the 2010 intake as the senior figure best placed to salvage something of the modernisation agenda from the bodge job of Cameron’s leadership and give it a steelier edge. Johnson, meanwhile, exudes a kind of Wodehousian anachronism that appeals to Tory traditionalists despite his liberal inclinations. The pairing would match someone who has won elections in hostile territory with someone who has a record of bulldozing civil servants and trade unions to enact a revolution in the public sector.

Whether that cocktail would be as obviously delectable to the public as it is to Tory MPs is a different question. A reliable guide to a party’s best course of action is to do the opposite of what its enemies wish it would do. In this case, Ed Miliband hopes that the Conservatives will continue to undermine Cameron’s leadership. The rational course would therefore be to unite behind the Prime Minister but the party has drifted beyond reason and into the realm of longing.

There are two things in particular that the Tories crave that Cameron, in their eyes, is incapable of providing. The first is popularity that reaches beyond core voters, yet without a hint of apology for being Conservative. The second is the firm smack of ideological constancy. In today’s party, those dream attributes come with names attached: Boris Johnson and Michael Gove.