Yes pigs eat mushrooms, including domestic pet pigs.
All pigs are omnivores, that gather and root for food. As a seasoned mushroom forager who knows her woods very well, I can confirm that wild boars most definitely eat wild mushrooms, as part of their diet - or in other words, on their treks where they pretty much till a forest floor on their search for roots and grubs, they will also eat whatever is growing on the top, including berries and mushrooms.
Domesticated pigs have the same dietary habits as wild boars.
I would strongly advise against taking Nintendo games as depicting or mimicking the real world. But that’s true for many games and other forms of storytelling. It’s called “fiction” for a reason.