RNA - The Iranian Students News Agency (Isna) said the fire was in an "explosive materials production unit".
A pro-opposition website reported a huge blast near the Parchin military site, south-east of the capital, but this was not confirmed.
Parchin has been linked to Iran's controversial nuclear programme.
The International Atomic Energy Agency (IAEA) has not been given access to the complex since 2005.
Analysts say the IAEA suspects Iran of experimenting with explosives capable of triggering a nuclear weapon at Parchin.
Windows shattered
The pro-reform website Sahamnews said the explosion on Sunday evening was so intense that windows of buildings 15km (nine miles) away were shattered.
The glare from the blast could also be seen from a great distance, the report added.
Isna, quoting Iran's defence industries organisation, said: "Unfortunately, due to the incident, two workers of this production unit lost their lives."
It gave no further details.
Iran is in negotiations with six world powers on a permanent agreement over its nuclear industry.
The West suspects Iran of trying to develop a nuclear weapon but Iranian leaders reject the allegation insisting they only want atomic energy.
Talks are focused on lifting Western sanctions in exchange for a scaling-back of Iran's uranium enrichment programme, and a deadline for the agreement has been set for 24 November.
R111/108/B/