> Afghanistan was relatively open during US and USSR occupations
Coincidentally in both cases the administrations propped up by US/USSR were thoroughly corrupted, incompetent and abusive (https://en.wikipedia.org/wiki/Bacha_bazi) so that even the Taliban became relatively appealing to most people.
> Iraq after occupation was relatively open, yet ISIS ideology took off
That was to a large degree just the extension of the whole Shia vs Sunni conflict/civil war which began immediately after the invasion.
Also I'm not sure what do you mean by "open" in all of the cases (besides post 2001 Afghanistan) the countries we ran by semi-secular authoritarian dictatorships which kept the Islamists in check. Most of the population would have (and eventually did) supported them if they were given a choice (like in Egypt).
The USSR was brutal autocracy. Us military occupation was also brutal and not free.
Iran was a brutal autocracy.
Egypt was a brutal military dictatorship.
Turkey is a great example, tbh. The level of radicals and terrorism there is far less than anything else we've described because it has open democracy. If anything, the big terrorists in Turkey are separatists which every nation, even European ones, has to fight.
Iraq after brutal military occupation? All of what you're talking about about are scenarios where brutal authoritarianism led to extremists gaining popularity because they are an excellent alternative to brutal one-man repression of an entire people.
> Turkey are separatists which every nation, even European ones, has to fight.
Generally only undemocratic/oppressive countries have to do that. e.g. violence in the Basque country, Northern Ireland etc. was solved by giving the local people a voice and stopping previous abuses. Escalation of violence was always the outcome of failures by the state rather than started by the "separatists".
Also Turkey only had or has "open democracy" to a very limited state. It was never more than a deeply flawed democracy at best.
> Iraq after brutal military occupation?
I don't think the occupation was even remotely more brutal than Saddam's reign in the 80s and 90s. Most of the casualties were the result of the civil war/conflict between Shia/Sunnis/other factions and general lawlessness. Much of that could have been prevented had the occupation actually been more brutal/oppressive (of course far from ideal either..).