Can it be prevented?

There are quite a few ways that can be applied to save oneself from getting infected by Ascaris lumbricoides. Since the eggs are the only source of ingestion that are transmitted through the fecal-oral route, drinking clean water and eating properly cooked food can greatly decrease the chances of ingestion.
Eggs of Ascaris lumbricoides can also be killed at high temperatures, therefore well-cooked food has fewer chances of infecting the body with the egg of Ascaris. Vegetables that are soil-based need to be properly washed in saltwater, so that the eggs can be destroyed. It is also advised to dip vegetables for half an hour before use.
References
Lamberton PH, Jourdan PM. Human ascariasis: diagnostics update. Current tropical medicine reports. 2015 Dec;2(4):189-200.
de Lima Corvino DF, Horrall S. Ascariasis.
de Lima Corvino DF, Horrall S. History and Physical.
Crompton DW. Ascaris and ascariasis.
Lamberton PH, Jourdan PM. Human ascariasis: diagnostics update. Current tropical medicine reports. 2015 Dec;2(4):189-200.



