Can I get pregnant from having a penis rubbed on me, no penetration or cum but I had my underwear on?

No. Sperm must be inside the vagina to fertilize the egg someone to get pregnant. Based on the activity you described pregnancy is not possible. Spend some time reading and studying up on human reproduction and sex. It’s important you have the information before you get in over your head.