The four-star general, who oversaw military operations in Afghanistan and Iraq, told BBC Radio 4's flagship "Today" program
that if Trump asked for his help, "the only response can be: 'Yes, Mr President.'"
Petraeus, 64, stepped down as CIA director in 2012 following an extramarital affair with his biographer, Paula Broadwell. He had been in the post for just over a year.
The Justice Department later recommended felony charges against him for sharing classified information with her.
At the time, politicians from both sides of the aisle
backed Petraeus, and spoke out against the Justice Department for pursuing the case.
'Yes, Mr President'
In the wake of Donald Trump's election victory, there has been widespread speculation that he could be put forward as Secretary of State in the new administration.
Petraeus served under both President Barack Obama and President George W. Bush.
"I've been in a position before where a president has turned to me in the Oval Office in a difficult moment, without any pleasantries, and said 'I'm asking you as your president and Commander in Chief to take command of the international security force in Afghanistan," Petraeus told the BBC. "The only response can be: 'Yes, Mr President.'"
Republicans argue that compared to presidential candidate Hillary Clinton's use of a private email server while she was Secretary of State, Petraeus did little wrong -- a point repeatedly endorsed by Trump.
But during the election campaign, FBI Director James Comey said Petraeus's actions
, in sharing classified information, hiding documents, and lying to investigators, were far worse than Clinton's email scandal.