Sex & pregnancy

If you're on the pill can you still get pregnant?
A few weeks ago me and my boyfriend were having sex and the condom split but I'm on the pill and I already took a pregnancy test that says I'm not pregnant but could I still be?