If you are already pregnant (even if you do not know it yet), EC will not work. EC can only prevent a pregnancy from starting; it cannot stop one that already has. And if you accidentally take EC before you know you are pregnant, it will not hurt you or the pregnancy.
References:
- FPA the sexual health charity. (2017). Your guide to emergency contraception. Retrieved from https://www.fpa.org.uk/sites/default/files/emergency-contraception-your-guide.pdf