Thanks for your post! Did you have sex ed at school? If not, it's a good idea to study on your own so you know how sex and the human body works. You can read books on this or search our own site. This will eliminate a lot of stress than the unknown can cause.
A woman cannot get pregnant unless she has unprotected sex (naked) with ejaculation. She would also have to be ovulating - you were not ovulating since you got your period right after. Also. sperm will not travel through a layer of clothing to impregnate and touching cannot get anyone pregnant.
So a pregnancy cannot occur from what you did.