can i get pregnant a few days before my period ???

soo i’ve read a lot of books and taken many anatomy related science classes and they all mention how a woman can’t get pregnant a few days before their period. so is it really true women can’t get pregnant a few days before their period starts ??