finishing inside of you

is it okay for him to cum inside you while on the pill? and not get pregnant