Hello, Anon! Thank you for posting.
May I ask, did you have sex education 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 EmpowHER site. This will eliminate a lot of stress than the unknown can cause.
A woman cannot get pregnant unless she has unprotected sex (intercourse) with ejaculation that enters the vagina. The highest chance for this is during ovulation. So, a pregnancy cannot occur from the scenario(s) you describe.
Below is a resource that can help. You can copy/paste the link.