Invasion of Middle East by allied forces cannot be considered the sole reason for terrorist activities around the world or the sudden outburst of these terrorist outfits. But, definitely there is a correlation. These invasions have emboldened the radical forces, provided them more exposure, know how, mode of funding, expansion and predominantly helped them going overt. The most serious consequence of their overt terrorist operations have been the spread of their cadres and surge in recruitment around the globe, not just in the Islamic world.
As far the terrorist outfits and their modus operandi goes, one may want go back to the 80's and 90's and study Afghanistan-Pakistan region. The birth of some deadliest modern day terrorist outfits like Al Qaeda and Taliban or the several small front groups they float. And how time and again these front groups either merge or rename themselves and come back as much stronger force. More importantly it draws a clear link between the so called Islamic jihad and state sponsored terrorism. Its interesting to find how young, uneducated youths from tribal regions of Afghanistan and Pakistan were picked up armed and funded both by America and its ally Pakistan in order to fight Soviet and post Soviet withdrawal from Afghanistan, they were left there to multiply and strengthen. When yo look at the war in Iraq and Syria and draw a comparison you might find the same strategy in place.
There was no invasion in Pakistan except some drone strikes by their own ally US and that too happened just a few years back but there history of terrorist association, related activities as well as promoting cross border terrorism goes back to the 80s.