Pregnant after withdrawal bleed?

Ol

If I have sex a few days before my withdrawal bleed, my boyfriend came inside me by accident, and then get my withdrawal bleed, is there a chance I could still get pregnant from this instance and get a positive test in 4 weeks even after having my bleed? I know with a period this wouldn’t be the case as the egg wouldnt have been fertilised, but I don’t know how it works for the pill. I’m new to it so any help appreciated