Eating corpses in Pillars of Eternity 2 Deadfire is certainly possible but it requires you to meet two conditions. Choose a Barbarian class in the character creation (either for your main character or, e.g. a companion bought in an inn) and select Corpse-Eater subclass. Thanks to that you will get a unique ability called Flesh Communion -this ability can't be used by any other class, not even the other Barbarian subclass.
As you can probably tell, this ability allows you to eat corpses of your enemies. You can do this twice per battle. Each consumed corpse restores 69,9 health points and 3 points of Rage. Your character isn't a picky eater which means that you can eat every corpse - human, animal or a beast. Enjoy your meal!