The semi-official 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.
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.
Last month, the IAEA said more activity had been conducted at the Parchin military base.
It said Iran had also missed a deadline to answer further questions about its nuclear programme.
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 insist 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.
A fire and explosion at a military explosives facility near the Iranian capital Tehran has left at least two people dead, reports say.