Early smokeless gunpowder contained nitrocellulose, the same stuff that's in the "exploding film reels". Not nice - or stable - at all when it ages. I have no idea what's in more modern cartridges.
Dynamite should be avoided, I agree.
TNT is a totally different compound, and tends to be either stable or inert. I've seen a 1942 vintage block of TNT blown to pieces by a firing cap - it took 2 sticks of octyl before we finally managed to set it off.
Tangentially, and "retracking", I'm glad that the box of 9x12cm colour film said "safety film" in big blue letters!