Yes, you can get pregnant by doing this. Sperm does not live long outside of the body, it's needs a moist environment to live. If he ejaculated in his boxers and they touched your bare vagina you have a small chance of pregnancy.
If there was no penetration of any kind with his manhood you should be perfectly safe