Iran is a problem, of course, because its Islamic regime stands for everything Jordan's government opposes, and vice versa. But Iran is relatively far away, on the other side of Iraq, and does not participate in the Arab political arena. Syria is much closer. Damascus would like to make Amman a satellite similar to Lebanon. The Syrians have also sponsored anti-Jordanian terrorism.
Coexistence is possible, but alliance is out of the question.
The case of Iraq is more complicated. Iraq is potentially Jordan's largest trading partner, and the sanctions against Baghdad have been devastating for Jordanian business. The pressure of Jordanian public opinion and fear of Iraqi military aggression led King Hussein to support Iraqi President Saddam Hussein during the 1990-1991 Kuwait crisis and ensuing war. After Iraq's defeat, Jordan switched sides. The US forgave it, but the Saudis and Kuwaitis are still angry.