I’m just asking a question about a part of the animals anatomy. I’m watching something on the discovery channel and where they are located they stated that, people in this part of the village eat every part of the pig . Every part!!! They worship the animal and to waste any of the animal is frowned upon. That’s why I was asking if you can cook and eat the pig’s testes?
Yes, testicles are just a part of the animal that is perfectly edible like many others. This includes mammals like the pig in your question, but also birds. They are usually served as special dish because like other organs they need certain preparation steps for best results.
The (modern) western everyday cooking culture tends to ignore parts of animals that are not nice steak-like cuts, but apart from certain exceptions like a few organs (think gall bladder), most animals are pretty much edible completely - and were used that way for human consumption because it's valuable protein and calories (so a basic necessity). Just consider the British steak and kidney pie or the German liverwurst, even "inedible" bones can be used for bone broth. Recent trends like nose-to-tail cooking go back to these roots even in a fine dining setting.
In animal husbandry, keeping multiple intact males in a herd can be problematic, so removing the testicles in young males has been a long-standing practice for centuries, making lamb/beef/goat/… testicles even a seasonal ingredient.
Organ meat is not only useful as a source of calories but they are also very nutrient dense. Becuase each type organ in the body is highly specialised, it will contain specialised amounts of vitamins and nutrients. e.g. Collagen in bone broth is good for our own connective tissue, liver and eyes are a very rich source of Vitamin A, etc. Arguably not eating offal today is making us all mildly/somewhat malnourished, e.g. Weston Price (1930s survey of nutrition and dental health around the world) seems like strong evidence that all orthodontics (crooked teeth) is due to malnutrition. Note milts are fish testicles but they may be called roe (eggs) in the shop (UK). Embrace eating those pig testicles.