Pets are creatures that follow the player around. They serve no specific function in the game; they are decorative only. Note that some pets tend to obstruct vision of the player, especially the flying ones.
Some pets are found in dungeon cages, some are dropped by bosses while others are sold by NPCs. All pets can be sold to any NPC trader for 20GP (except for the Princess of Fire, who sells for 400GP, and the boxers).