You can't get worms through goat milk, and even if you could, your body would digest them because worms are species-specific, so goat worms can't infect humans.
Wild goats are some of the healthiest and hardiest animals on earth, which is why they are so invasive and there are so many. On many islands the government (Santa Cruz in the US, Galapagos, etc) has taken to shooting them because they were destroying the ecosystem.
At a minimum, you should filter the milk before drinking it. If you use fabric to filter it, you should boil the fabric between uses. In the US, we have disposable filters that fit into a funnel, but historically fabric was simply draped across the top of a bucket or jar and the milk was poured through it.
If you can't do any testing for diseases, you might want to pasteurize the milk, which just means you heat it to 170 degrees then quickly cool and refrigerate.
If these are feral goats, it might be a challenge learning to milk them. Here is more info on that:
https://thriftyhomesteader.com/learning-to-milk-goa/