Some pigs do eat other dead pigs when they are hungry enough.
If the pig is on a farm and being fed and not hungry then they will usually not eat dead pigs that die near them.
However some farmers who farm pigs may and have fed dead piglets to hogs for food and the hogs ate the dead piglets.
Most pigs in the wild would prefer to eat something else unless they could not find any other food.
Then in that case the pig could decide to eat the dead pigs.
But the dead pigs would be the last resort for food for the pig.