The two men, who were not named, were in their 50s and belonged to a group of 15 Germans working for a Singaporean company, a spokesman said. A third German was injured.
The explosion occurred during preparations for Hanoi's millennium celebrations when two containers holding fireworks caught fire. The Vietnamese government said four people, including three foreigners, were killed.
Singapore's Foreign Ministry said one of the dead may have come from the city-state, while official Vietnamese sources identified the other fatality as a native of Vietnam.
Local media showed pictures of a thick cloud of smoke after the blast which sent large chunks of metal flying and shattered windows at least 200 metres away.
Reasons for the blast "remain unknown," said an unnamed source from Interserco, the Vietnamese fireworks importer involved in the accident. "We are waiting for a final conclusion by the investigators."
The government has blamed the blast and fire on "carelessness during the process of transport."
Despite Wednesday's tragedy, local media reported that a rehearsal took place Wednesday night at the stadium ahead of Sunday's grand finale.
The show featuring lasers and thousands of performers depicts Vietnamese history and will cap 10 days of exhibitions, cultural performances and other events for Hanoi's 1,000th birthday.
"The event will finish with a magnificent display of fireworks in several places around Hanoi," the website of Voice of Vietnam radio reported.