What you’re describing is a radioactive thermopile. They have incredible longevity (based on the half-life of their fuel), provide very stable power, and have no moving parts. The down sides are their power/weight ratio, which is TERRIBLE, and the mentioned radioactivity. The only places I know of that they’re regularly used is deep space probes, though that’s mostly because the good ones use fissable plutonium, which people are rightly paranoid about leaving lying around.
Re: power generation from guns, if you think about it, blowback mechanisms are just used to load a spring, you could just replace the spring with a ratchet mechanism for a flywheel or similar and use that to generate power. It’d be much heavier and more complicated than the spring, between the flywheel and the generator (you’d have this weight increase with a turbine too), but would supply a decent hunk of power, should be enough to provide electrical igntion for caseless ammo.