Cannibalism is eating a monster of your own race. Generally speaking, this is a bad idea: you will gain the aggravate monster intrinsic and lose 2-5 points of Luck. If you are an orc or Caveman, though, cannibalism is considered natural for you and you will not be penalised.
If you are a dwarf, an elf or a gnome, it should be clear which monsters are your own race, but if you are a human it can be harder to tell. Anything represented by an @ sign that isn't obviously an elf is human, including werecreatures and doppelgangers. Keystone Kops (anything represented by a K) also count as human. Beware: A human character should not use blessed tins of nurse meat except in emergencies!
Eating a cat or dog is also frowned upon and will give you aggravate monster unless you are an orc or Caveman. However, there is no taboo on eating horses or any other monster that was once your pet. (This is different from the rules for sacrificing where you may not sacrifice your own pet but may sacrifice a wild cat or dog.)
Note that cannibalism is not affected by polymorph, i.e. a human player polymorphed into an orc will still suffer the penalties for cannibalism when eating a human corpse. However, digestion attacks are never considered cannibalism, only eating the corpse of same-race monsters.