Sir William said violence in Basra had increased during his time in Iraq
Ambitions for reforming Iraq after the war were "probably higher than the ability to deliver", the former UK ambassador to the country has said.
Sir William Patey, in the job from 2005 to 2006, said there was no "quick fix" for changes such as setting up a police force and drafting a constitution.
The Iraq Inquiry heard that "what could be delivered on Powerpoint couldn't necessarily be delivered on Earth".
But the UK had not been "helpless or powerless", Sir William added.
During his time in office, Iraq was moving from a transitional government to full sovereignty, amid widespread schisms between different groups within the country.
Iraqi politicians were involved in drawing up a post-Saddam Hussein constitution, despite the fact that Sunnis had refused to take part in the process.
Sir William recalled that he had written at the time that "the prospect of descent into civil war... was probably more likely than the transition to a stable Iraq unless certain things happened".
These included getting Iraqis involved in self-government and handling their own policing and security arrangements.
Sir William said: "What we couldn't quite expect was the level of historic baggage we found when we got there...
"The constitution was essentially being drawn up the other two groups - the Kurds and the Shias. We were trying to engage with the Sunnis to bring them into the process."
On the other hand, many Shias had a "fear" that the Sunni Baathists who ruled Iraq under Saddam Hussein might return.
Without the involvement of all sides, there was a danger the constitution could be "stillborn", Sir William added.
He said he had mentioned his own Scottishness when dealing with Kurds who felt alienated from the process.
Sir William told the inquiry: "I used to have a joke with the Kurds that... we were the troublesome hill people from Britain and they were the troublesome hill people from Iraq."
November-December 2009: Former top civil servants, spy chiefs, diplomats and military commanders gave evidence
January-February 2010: Tony Blair and some other politicians expected to appear before the panel
March 2010: Inquiry expected to adjourn ahead of the general election campaign
July-August 2010: Inquiry expected to resume
Report set to be published in late 2010 or early 2011
This, along with an illustration of how Scottish devolution had functioned without causing the break-up of the UK, had "proved quite persuasive" in encouraging Kurds to stick with the process.
Speaking about the security situation in UK-controlled Basra during his year as ambassador, Sir William said: "I think the level of violence changed while we were there. It had been a relatively benign area...
"In a sense we became a target and people tried to portray us as occupiers."
This, along with corruption and infiltration by militia groups, made it more difficult to set up an effective police force in the area, Sir William said.
He told the inquiry: "I think we were planning on the job. I think we started by thinking we would look [to set up] a Surrey Constabulary in Basra and ended up with the RUC [Royal Ulster Constabulary]."
However, he said: "When things weren't working, we didn't just keep pushing on."
Sir Ronnie Flanagan, the chief constable who oversaw the transition in Northern Ireland from the RUC to the Police Service of Northern Ireland, had visited Iraq to offer advice, Sir William said.
He added: "I think it was never going to succeed until the Iraqi politicians took responsibility for it... There's no point compromising over a police force that's not going to uphold the rule of law. We have to be patient and get local people to buy into it."
The experience in Iraq had shown there could be no "quick fix" for similar campaigns in future, Sir William said.
"The level of ambition was probably higher than the ability to deliver."
Sir William said he had found that "what could be delivered on Powerpoint couldn't necessarily be delivered on on Earth. That's something that struck me in my time there."
The Iraq Inquiry is looking into UK policy on the country between 2001 and 2009.
Former prime minister Tony Blair will be among the witnesses, with its report due to be published in late 2010 or early 2011.