Is it possible to use gunpowder as a fuel for automobiles??

I was just watching videos about guns on the YouTube and saw how the bolt is pushed back once a bullet is fired. so i just wanted to relate the bolt of a gun with the piston of a car.