Solid rockets have some advantages such as high thrust (good for using the Oberth effect), storability and reliability. The main problem is that they fire all their fuel once in one set way. But couldn't a spacecraft utilize an arbitrary orbital correction by simply jettisoning the solid rocket before it has finished? Depleted solid boosters have been jettisoned from launchers hundreds of times. Could it be done in space, for example as an emergency system to deorbit a crewed mission in LEO?
Problem with separating SRB during burn, be it to use SRB to accelerate or decelerate for reentry, is that you'd have big problems designing their mounts so they detach while they still accelerate in the direction relative to the main vehicle for which they would be designed to have the strongest grip to it. Once they're depleted, it's the vehicle itself that accelerates in some vector opposite to what before it SRB were also meant to help with, or they're inertial to each other, so it's easier to simply slide them off to detach.
But it's not impossible, it would just complicate design somewhat, which makes everything heavier and potentially less reliable, so it's avoided. SRB near depletion don't have that much thrust any more due to less than ideal expansion of solid propellant's grain geometry, so if you do it late enough, it ought not create additional problems with its exhaust plume to the vehicle that's designed to either go supersonic on ascent, or hypersonic on descent, even if they were pointed for a short period close towards it. Of course, you could always use gimballed nozzles to avoid that entirely. Or eject their core, blow open the top, muffle the nozzle, tear apart SRB's sides lengthwise with small charges, or use some flame retarding system, whichever makes more sense depending on exact implementation. And you might need to do some of this anyway, to avoid collision with SRB body, which would have catastrophic consequences.
Alternatively, use a tractor or a puller design. You'll lose some thrust with canted nozzles (cosine of the angle to acceleration vector, so it's not so bad for smaller angles), but it's designs we already use for launch abort systems and alike. And more often than not, they rely on solid propellants for such tasks. E.g. Saturn V ullage motors used during stage separation, or Orbital ATK designed Orion MPVC's launch abort use solid motors. Those would be relatively safe to jettison before depletion, but you might wanna make sure they don't lose attitude during separation.
The same problem was encountered by the designers of the Minuteman missile. They used a system whereby ports were opened in the nozzle, and the extremely fast drop in pressure would snuff out the flame. Link.
As noted in some other answers, the Minuteman III ICBM 3rd stage had "ports" that were opened and brought the solid rocket chamber pressure to zero which effectively terminated thrust. The Peacekeeper ("MX") ICBM used a more elegant solution and used a 'fuel wasting' manuever to avoid having such ports. The guidance system lofted the trajectory so that the desired velocity was achieved when the solid rocket fuel in the 3rd stage was depleted.
If you jettison a booster before depletion, it will accelerate ahead of the rocket/spaceship, and you get blasted by the booster's exhaust gases. You'd have to use powerful motors to get the booster out of the way quickly, and if one of those fails, the booster will ram the rocket/spaceship.
What is usually better is to eject the fuel, and not the rocket. Alternatively you can simply expose the combustion chamber, without an ability to maintain pressure the rocket will stop firing. Ejecting the rocket can be quite dangerous, as others have mentioned. But these techniques can effectively leave the rocket inert. They aren't really precise, but they do work. See, for instance, this patent, among other concepts
This is commonly used in military rockets on Earth, which have to be ready to go at any time, and require precise maneuvers. The launch any time leads to solid rockets, the precision requires cutting off the thrust.
If you want to do an orbit correction requiring 30 % of the solid rocket burn time, you cant use the remaining 70 % for a later maneuver. That is too expensive if you need several burns. A good rocket for orbit corrections allows a lot of short and longer burns. The efficency of the fuel mass is much better than.