Welcome to the forum. I'm assuming you mean once the sim in question is pregnant? Then in that case... sort of. If you use the cheat sims.remove_all_buffs I believe that the pregnant sim will still go through the pregnancy but basically not give birth to anything. (Not 100% sure about this.)
If you want to prevent a sim from ever becoming pregnant then only use the 'woohoo' romantic option in-game or in CAS choose the setting 'Customize Gender>Neither'. This means that the sim will not be able to be pregnant or to get other sims pregnant.