I find the distinction between 匹 and 頭 is rather tricky, because it is based on the size of the animal in question, and size is very relative and varies greatly among animals, even within the same species. And unfortunately there doesn't seem to be comprehensive list on which animal goes with which counter.
So when you look at an animal, how do you determine which counter to use?
Is it based purely on size or on collocation (or conventional usage if you will)? Roughly speaking, how big is "big" and how small is "small"? And if it's usually based on collocation, how do you expand the rule of thumb to unfamiliar animals, like say a capybara, a python or a binturong? Do all breeds of dog go with 匹? What about huge ones like the St. Bernard? Does "two piglets" use the same counter as "two grown pigs"? From what I've Googled, kangaroos seem to go with 匹 even though lots of them are so big they can easily knock a grown human out.