If you decide to sell your car while you have a service plan still active, then you have a few options.
You should be able to cancel a plan and have any balance returned to you at any time.
If you are purchasing a vehicle from the same manufacturer, or you are intending on using the same dealership, you may be able to transfer the service plan to your new car.
If you decide to sell your car privately, you may be able to transfer the service plan to the new owner, adding extra value to your car.