In an interview with Aljazeera television, Khatami noted that "there are regional powers which possess nuclear arms."
Israel is widely thought to have a nuclear arsenal.
"How come these powers do not face the wrath or pressure from Europe or the US in order to make the Middle East free of such weapons?" Khatami said.
"I believe that the double standards are to blame for the crisis in our region and the world, because if a rational and fair approach were pursued, all issues of contention could be resolved easily and peacefully."
Khatami, who reiterated Iran's position that it has not developed nuclear weapons and does not seek to develop them, ruled out any possibility of a military attack against Iran's nuclear or other strategic installations.
"I do not believe a military offensive against Iran is possible," Khatami said, citing the problems faced by the US in Iraq.
Khatami said that Iran's nuclear
project is peaceful
Other forms of pressure, perhaps political or economic, he said "may have an impact", but he said sanctions would be unwise.
"I believe it would be a big mistake on the part of Europe or the US to apply such pressures against Iran, especially since oil prices have soared."
"Any more pressures would drive oil prices further upward and the entire world would suffer," said Khatami, who was president for two terms, from 1997 to 2005.
Iran has refused to shelve uranium enrichment-related work, which it says is to generate electricity, not to create a nuclear arsenal, as the West suspects.
So far, talks have failed to resolve a stand-off between EU powers and Iran over its nuclear work before a UN atomic watchdog meeting on Monday.
That meeting may lead to Security Council action.
Khatami, insisting on Iran's right to pursue nuclear technology, acknowledged that "Iran has to engage in negotiations, dialogue and confidence-building with any party that feels concerned by the prospects of developing nuclear weapons".
"We should resolve this problem through negotiation and dialogue," he said.
"It is in the interest of Europeans and the region to resolve this crisis peacefully within the IAEA and recognised international standards"
former Iranian president
He said he had always told "our European friends that these pressures and pretexts offered against Iran would not be in the interest of Iran, Europe or the United States".
"It is in the interest of Europeans and the region to resolve this crisis peacefully within the IAEA and recognised international standards."
Khatami said he hopes other nations will recognise Iran's rights.
Khatami said that the US-led invasion and occupation of Iraq had failed to prevent terrorism or make the world more secure, adding that US policy had "lost and failed miserably".
"The kind of terror and extremism plaguing Iraq now were not even seen during the Taliban reign in Afghanistan," he said.
Khatami says the US has failed
miserably in Iraq
He said the removal of Saddam Hussein was seen to be in the interests of the Iraqi people, the region and the world.
"The violence witnessed now in Iraq should be seen as a warning, as it could derail the democratic process and might spark a civil war that would not be in the interests of either Sunni or Shia," Khatami said.
This violence, he added, could prolong the presence of occupation troops.
"We believe the restoration of stability and the establishment of a government that represents the will of all Iraqi people could speed up the withdrawal of the occupation troops."
Khatami, whose stance on social and political freedoms made him popular with the young during his tenure, said there was a good chance that reform would continue in the Islamic republic.
"If reforms in Iran are based on what the people demand and the objective of reforms is to consolidate democracy and achieve development in various political, economic, cultural and social fields, then it will never stop.
"But as you know, reform takes gradual steps, unlike revolution."
Muhammad Khatami was interviewed on the Aljazeera satellite channel. This article is based on a translation of the interview.