In Iraq, the Shias are in the majority like in Iran. However, Saddam and the ruling elite were Sunnis, so the majority Shias got a raw deal. Saddam hated al qaeda, and during his leadership they stayed out of Iraq.
After Saddam, a civil war broke out in Iraq with Iran supporting the Shias against the Sunnis.
it is more likely the people the Iranians have executed were al qaeda and not Iraqi Sunnis. Though al qaeda are an extremist Sunnis organisation, they have attacked Sunnis in Iraq.