Parshat Acharei Mos
In 16:2 Hashem tells Moshe to tell Aharon. "ואל יבא בכל עת אל הקדש...ולא ימות" - that he cannot just walk into the Holy of Holies whenever he wants... and he will not die.
Rashi adds that this is so he should not die the way his sons died.
His sons died because they brought unauthorized sacrifices in the Holy. They did not just walk in. Also over there the commentaries search for alternative explanations that were the cause of their deaths. Such as they decided halacha in front of Moshe, or they entered the Holy while inebriated, etc.
So how does this warning compare to the death of Ahaon's sons?
The only answer I can think of offhand is that it is referring to the method of death. The punishment would be the same even though the offense is different (slightly).