can you get pregnant if you have unprotected sex a week before your period?
It depends upon when you ovulate.
Assuming a 28 day cycle, you'd ovulate between days 11-16. The egg is only viable for 48 hours or so after ovulation. So, while not impossible, having sex on day 21 would likely not get you pregnant.