it is possible but not likely at all
The only way you can get pregnant is if his sperm comes in contact with your vagina. If he is simply rubbing himself on you through his boxers, there is a very low chance you could get pregnant. You must always remember that even if a guy doesnt ejaculate, there may still be some sperm around the tip of his penis and you need to be careful about that. It is also referred to as "pre-***".