For answering this question many factors have to be considered. Animals have many adaptations to their natural environment in which they have evolved that may cause adaptation problems and/or risks in captivity. Problems may be visible in behavior, welfare, health, and/or human–animal interaction, resulting, for example, in stereotypies, disease, and fear. A framework is developed in which bibliographic information of mammal species from the wild and captive environment is collected and assessed by three teams of animal scientists. Results of the recent study investigating pet suitability of 90 mammal species, show the sika deer is most suitable while the screaming hairy armadillo is the least suitable to be kept as pet.
Several species of animal have been kept in captivity for so many generations that they have evolved the necessary psychology and physiology to be better adapted to domestication than to a feral life.
The dog is the poster child for this phenomenon. It's generally assumed that their evolution began when some lazy, adventurous wolves slowly approached a human camp and began eating the perfectly good food the humans discarded, calling it "garbage." The humans appreciated their presence, since with their much stronger sense of smell, their night vision, and their fighting skills, they allowed the humans to sleep longer without worrying about predators. This was a milestone in our own evolution, because longer periods of sleep allow our brain to do a much better job of organizing the information gathered during the day.
With humans ultimately in charge, the dogs didn't need to be quite as intelligent as their ancestors. As their brains slowly shrank, they became more adapted to a lower-protein diet--with discarded vegetable matter now as their primary food source.
Unnatural selection continued to reshape their psychology. Baby wolves enjoy barking, playing with sticks and roughhousing with each other, but as they reach adulthood these activities are forgotten. But humans find these things "charming," and after a few millennia the phenomena of
neoteny resulted in dogs behaving like puppies until the day they die.
Dogs were clearly the first domesticated animal, but other species that have been domesticated have also developed behaviors that humans find charming and entertaining.
The cat is an interesting example. When the Agricultural Revolution launched the Neolithic Era, with people living in much larger communities and building permanent structures, one of the first types of buildings they learned to build were granaries. In no time, rodents of various species began to regard these buildings as their own private cafeteria. At this time cats were completely feral, but when the humans noticed the cats reducing the rodent population, increasing the volume (and cleanliness!) of their own food, they started looking for ways to keep the cats around 24/7. Simply letting them live inside their own homes, where they could stay warm and their babies were safe from predators while they were out hunting, was a marriage made in heaven.
Pigs are scavengers like dogs, but unlike dogs they're rather large and carry a lot of meat. Our ancestors domesticated them, but as food rather than pets. (And of course it must be noted that dogs have been used as food in several different cultures.)
Every domesticated species has a story to go with it. To dismiss domestication as a travesty for the poor animals is overly simplified and flies in the face of both prehistory and modern history.
Take the capybara, the largest species of rodent that can reach close to 200 lb. In the wild, they're prey for every predator in South America, from alligators to cougars. They're lucky to see their third birthday. But in captivity, they have a wonderful time playing with our dogs and other pets, and often live to be ten years old. All you need to make a capybara happy is a swimming pool, since in the wild they spend much of their time in the water. The internet is bursting with amusing photos of domesticated capybaras playing with people and their other pets.