Iraq is also ground zero in the war between the two sects (Shia and Sunni) proclaiming themselves the competing leaders in the effort to establish a worldwide caliphate (Islam rules the planet.) Al Qaeda is the most prominent of the Sunni groups seeking to establish the caliphate, a Sunni led caliphate. Iran, which has been ruled by Shia clergy for the last two decades, wants a Shia led caliphate. Most Iraqis are Shia, but have been ruled by the Sunni Arab minority for centuries. That, more than anything else, is why the amount of terrorist activity is so high in Iraq.
But the second most active front for al Qaeda is Pakistan, where there have been about two dozen terrorist attacks a month this year. Like the attacks in Iraq, the Pakistani ones average about four casualties (including one dead) per attack. But in Iraq, some 3,000 people a month are dying from various terrorist attacks. That's about a hundred times the level in Iraq. However, both Iraq and Pakistan have a situation where the Islamic terrorism is mixed in with other sources of conflict. In Iraq, the Sunni Arabs see their economic well being as being heavily dependent on running the country. And with all the oil money, it's something worth fighting, dying and, especially, killing for.
In Pakistan, the secondary factor is tribalism. While the tribes make up less than ten percent of the countries population, they occupy vast border (Iran, Afghanistan and India) areas. The tribes are used to ruling themselves, and are armed with rifles and automatic weapons. The tribes are culturally conservative, which is the main reason they are still tribes. That includes religious conservatism. The tribes will shelter members of al Qaeda and the Taliban, and join them as well.
There is also some Sunni/Shia conflict in Pakistan, but not nearly as much as in Iraq. That's mainly because the Pakistani Shia are a minority, and do not live in the tribal territories. Thus the Shia are only at risk from the smaller number of Islamic radicals found in urban areas.
Without the support of a larger issue, Islamic terrorism has a hard time gaining much momentum. That's the case in all the other nations mentioned. Afghanistan, you might think, would be as receptive to al Qaeda as their fellow Pushtun tribesmen across the border. But, to a large extent, they aren't. That's because al Qaeda allied itself with the Taliban in the late 1990s, and became the enforcers for the Taliban. As a result, most Afghans equate al Qaeda with a bunch of heavily armed foreigners, coming to punish them for disagreeing with the Taliban.
In the other nations suffering from Islamic terrorism, it's usually the case the a much larger segment of the population is actively opposed to Islamic terrorism. Thus outnumbered, al Qaeda battles on in a war they will eventually lose.
Since the United States took the offensive in the war on terror, nearly all the Islamic terror attacks have been in Moslem countries. The American move in to Iraq and Afghanistan is an ancient tactic, and is also called "forward defense," or "taking the war to the enemy." In addition to Iraq, where Sunni Arab nationalists have joined forces with Islamic radicals to try and gain control of the country, there is also lots of Islamic terrorism in Pakistan, India and Bangladesh. There's some, but much less, activity in places like Saudi Arabia, Afghanistan, the Philippines, Thailand and Indonesia.