Whether or not it's legal to throw someone out of your car depends on the circumstances.
If someone is just annoying you then you could just pull over and tell them to get out that is unless they are your kid.
You can't throw your kid out of your car but if it's just a friend or someone you picked up then yes you can have them leave the car.
You cannot use any force to remove them from your car or injure them in the process.
But if the person is harming you or trying to harm you and you fear your life is in danger you can throw the person out of your car to save yourself.
If possible call 911 if someone is becoming a threat to you in the car.