Germany and France, both NATO members, did bot participate in the Iraq war. Also NATO itself did not as there was no consensus among the members to be involved.
In Afghanistan there was the necessary consensus (and Article 5 was invoked) so NATO took an active role and ran ISAF - to which Sweden contributed quite significant troops.
The only way that would happen, is if a NATO member was attacked first, on a territory in the North Atlantic. A NATO member who goes off on their own and starts a war isn't entitled to calling NATO to its defense.
It's important to remember that NATO wasn't involved in the invasion of Iraq. That was a US/UK invasion, with a small contribution from Poland and Australia.
NATO countries only have to react if other member countries are attacked. NATO did not participate in Iraq; some members did but as a coalition they did not. They did participate in some operations in Afghanistan post-911 however, because that was a direct attack on a NATO member. Also saying the US or NATO are remotely similar to Putin is both-sides-ing nonsense.
Well Sweden could later leave the alliance if it no longer fit its interests. I doubt they would leave just to get out of being "dragged into another Iraq-like war" since well supporting your allies is the whole point of NATO, but if the US or the rest of NATO took the place of Putin, then maybe Sweden really would leave the alliance.
edit: Also wasn't article 5 invoked by the US against Afghanistan and not Iraq? (Maybe I'm not remembering right.)
As a Swedish citizen, I think this means in the future Sweden's forces will be dragged into another Iraq-like war down the line.
Sooner or later the US or NATO will be the Putin of today, and I don't look forward to that.