Was al Qaeda linked to Iraq?
Prior to the Iraq War, no. Saddam Hussein was an ardent Nationalist Secularist and opposed the Internationalist Islamist agenda of Al-Qaeda. Both are notably violent philosophies and both are in the Islamic World, but that is where the similarity ends. Both people/organizations had a fundamentally different view of the world and therefore were not aligned.
When the Iraq War started, the Iraqi Republican Guard and the remainder of the armed forces were drawn away from the border to deal with the US-led invasion force. This allowed al-Qaeda militants to more easily penetrate the borders of the country. From 2003-2006, remnants of the former Iraqi military (after the US-led Coalition conquered Baghdad) and al-Qaeda militants began to form an uneasy alliance against the foreigners. This alliance broke down as more and more former Iraqi soldiers were able to integrate into the new Iraqi Government or get jobs outside of the military.
By 2007, domestic Iraqi al-Qaeda cells had formed in most Sunni-dominated Iraqi provinces (since al-Qaeda is a Sunni-leaning organization). The new Iraqi Government aligned itself with the US coalition, the Kurdish Peshmerga military, and the local Sunni Sheikh Awakening Councils in a push to eliminate al-Qaeda in Iraq. Success was made on this front, especially in light of the US "Surge" and by 2010, Iraq was relatively safe from al-Qaeda. However, the US withdrawal in 2011 and the increasing factionalism between the Shiite-led Iraqi Government and Sunni-led Awakening Councils has led to al-Qaeda becoming more prevalent in Iraq.