Cameron confirmed this week that he intends to stay and oversee the process of leaving the 28-member bloc if voters back a so-called Brexit, despite leading the campaign to remain.
But Ken Clarke, a pro-European who served as a minister under Cameron as well as former Conservative premiers John Major and Margaret Thatcher, said such a situation would be "farcical".
"The prime minister wouldn't last 30 seconds if he lost the referendum and we'd be plunged into a Conservative leadership crisis which is never a very edifying sight," he told BBC radio.
Johnson, a likely candidate to succeed Cameron as Conservative party leader, told a rally in Newcastle in northwest England that "obviously David Cameron should remain in place".
More From This Section
Asked if he would be prime minister on June 24, Johnson said: "I certainly won't".
Opinion polls suggest Britain is deeply divided on the issue of whether to stay in or leave the EU, and the Conservatives are also split.
Clarke warned that the Conservatives were "dangerously close" to the bitter divisions over Europe that split the party in the 1990s and left it so badly damaged that it was out of office between 1997 and 2010.
"The party was unelectable because it had just had the most appallingly bitter civil war and it was impossible to see how it could carry on. Now we mustn't repeat that," he told BBC radio.