If a girl’s menstrual cycle is 28 days (4 weeks) and a girl ovulates 2 weeks before her period, can she get pregnant the day or two after her period? I mean sperm live only inside of you for 5 to 7 days - that means she still has a week before she ovulates. Can she get pregnant the day after her period? The egg is nowhere in sight during that time.

What you describe is a textbook menstrual cycle and your logic is correct. The problem is that females are not textbooks. A female, especially during adolescence, may ovulate at any time during her cycle, or even more than once. Thus, anytime unprotected intercourse takes place, a pregnancy and/or STD transmission can occur.