I feel obliged to point out that heating it in an oven wouldn't neccisarily detonate dynamite. The Nitro in Dynamite is stabalised so that it isn't heat detonated.
You need an impact or jarring force, to set off dynamite.
However, you still shouldn't heat dynamite, as doing so can cause the nitro to leak out. Unstablised nitroglycerin is extreamely dangerous and isn't a thing you want in you kitchen, or even anywhere near your house.