Piglins and Hoglins can willingly pathfind into fire. This is most noticeably apparent for piglins when a hoglin is held over a large platform of fire or if a path that is on fire is the only path to get to the hoglin this bug does not seem to be present when fire is substituted with lava
As for Hoglins, surrounding them with fire will not prevent them from walking into fire
Thank you for your report!
We're actually already tracking this issue in MC-172209, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki