Confused

So today I had sex with my bf and it was extremely pain. 😖 my friend said I was probably ovulating but on my period tracker it says I ovulated last week. Is it possible to ovulate 4 days before period?