Space is filled with cosmic rays that are high-energy particles. If we could convert that energy into electric (or any other) energy, then we could use it to power a rocket anywhere in the universe. If that is not possible, why not?
The problem is with the low energy density of cosmic rays in the universe. Individual cosmic rays are indeed very energetic, but there just aren't enough of them to be a significant power source for interplanetary or interstellar vehicles. The Wikipedia article about cosmic rays (https://en.wikipedia.org/wiki/Cosmic_ray) quotes the energy density of cosmic rays in interstellar space as roughly 1 eV per cubic cm, or 10^6 eV per cubic meter, which is only ~1.6 x 10^-13 Joules per cubic meter. Cosmic rays are so energetic that they're all traveling at nearly the speed of light, so if you multiply 1 square meter by the speed of light (~3 x 10^8 m/s), then multiply by the volume energy density just stated, you get the average energy flux density, which winds up being ~5 x 10^-5 Watts per square meter. Wow, that's not much! If you could convert that energy to electric power with 100% efficiency, it would take a collecting area of nearly 21,000 square meters (a square ~144 meters on a side) to collect one Watt.
The Wikipedia article also states that the cosmic ray flux inside our solar system's heliopause is about a tenth that in the interstellar medium.
Using cosmic ray energy sounds like a good idea at first, but the realities of the universe say no.