Can a girl get pregnant when the penis touches the outer part of the vagina?

Yes. As long as sperm is in/near the vagina she can get pregnant.