From person experience:
When ammunition is burned it will explode with the same force as if it were fired from a handgun/rifle/shotgun. IF the ammo is in a contained, pressure controlled area, i.e. a chamber, the ammunition will fire as if someone pulled the trigger of the firearm and will react in the manner to which it was designed to operate, firing the projectile from the chamber into the barrel and into/through whatever is in front of the barrel.
In theory:
If the ammunition is "Loose", i.e., factory box, laying around in a speed loader/magazine it will detonate much the same as a fragmentation grenade, sending shrapnel in a theoretical 360* path. Considering the weight difference between a typical 17 Mach 2 to 50 BMG or 410 to 10 ga vs. a frag grenade the chances of injury are minimal since the loaded shell weighs much less than a frag grenade, offers a much lower ratio of weight to explosive expansion volume and is made of much softer (generally) metal than is available in the casing of a frag grenade, therefore generating much less energy at the point of detonation.
Class III