Some history helps. It is often said in the west that Turkey is an important ally because it is a link to the Moslem world. However, Turkey has a defense pact with Israel. That puts a strain on its relations with both Arab countries and with Iran. Iran also expresses concern about the repeated suppression of Moslem culture by those in power in Turkey.
Turkey also has close connections with Albania.
Given instability in the Balkans, this further increases Greece's anxiety about Turkey's intentions. These factors provide the context that leads Iran and Greece to be open to explore better relations with each other. The way that NATO dealt with the Kosovo crisis also motivated Greece to explore alternatives. The Greek population was not amused by what they considered to be NATO hypocrisy. NATO has turned a blind eye to Turkish attacks on the Kurds, to Turkish territorial claims on Greece and to human rights violations against the Serbs.