Sure, geography is a major factor in the long run:
[Iranian President Rouhani] and his contemporaries have the heft of geopolitics on their side. Though Iran's rhetoric has traditionally targeted the United States, it is Turkey and Russia that may be more likely to threaten Tehran's security interests, especially as Washington withdraws from the region. Iran is deeply concerned about Turkey's resurgence in the lands it previously controlled during the Ottoman Empire, including Iraq and the Levant. And Russia — a country with which Iran has fought numerous wars — has similarly increased its involvement in Tehran's backyard over the past decade. Detente with an external powerhouse like the United States would certainly improve Iran's position against both threats.
This is a country whose national motto is "Death to America!" Well, not officially, of course. And a lot of people are against the rulers who make them chant that. But the national rulers to think that and do act as if they believe it.
As long as nutball mullah rulers act as if America is their enemy rather than the long-standing security threats from Turkey and Russia, the forces of geography--and distance makes America a safer ally--will be held at bay in thrall to religious fanaticism.