Some people, possibly trying to justify the 2003 war on Iraq, have tried to tie Saddam to the Taliban. Such ideas are pure smear and have no basis in fact. Just as one example of the tenuous nature of such allegations, consider this declassified-on-purpose US State Department cable excerpt:
In 1998 a Taliban spokesman meets secretly with US DOS and "wonders" (after American prompting) if Saddam Hussein is, like a snake, the "root cause" of Al-Qaeda. It's absurd to treat garbage like this, as some kind of "proof" that the Taliban was connected to Saddam Hussein.
Saddam Hussein and the entire Baathist government of Iraq were Alawites, like the Syrian governing minority. They worship figures like the prophet Hussein, although the dimensions of their religion are obscure because it has secret elements. The Taliban is primarily composed of Pashtuns who are Sunni and they hate the Alawites, whom they view as heretics. The Taliban regularly massacres the Alawite minority in Pakistan and Afghanistan. On 8 May 2015, the Qatari (Sunni) television channel, Al-Jazeera, broadcast a debate intended to explain the necessity for all Sunnis to torture and massacre all Alawites. They conducted a "poll" the results of which was that 96.20% of viewers believed all Alawites should be put to death. That's the nature of the "relations" between the Taliban and the Alawites.
I would not consider Iraq and Iran to be "bitter" enemies. Although they fought a war, there were primarily political reasons for the war. From an ethnic and religious point of view the two are much more similar to each other than to the various Sunni tribes. The Alawi religion is roughly aligned, like Iran, with Shiite Islam, so although the Iranians are suspicious of them, they are not calling for genocide against them, the way the Sunnis, like the Taliban, do.
Did they try to join forces against it? No. At the time in question the Taliban was a irregular force with no fixed leadership, no heavy weapons and an ideological hatred for Alawis.