Many puppies eat the poop of other animals when they get a chance - it's a gross habit, but very normal for dogs.
In most cases, it won't cause any serious problems but you should be cautious if the pigs have been dewormed recently as many livestock dewormers are toxic to dogs and may still be present in the feces.