Welcome to HealthcareMagic forum.
Parasites such as thread worm bread in the intestines and pass out of stool. It doesn't affect pregnancy
or your growing fetus. Further you do not need treatment even if you were infected with it till completion of pregnancy.
So do not worry.
If you suspect infestation you may get your blood and stool tested – if found positive, you can wait till completion of pregnancy and then take treatment for it.
Hope this answers your query.