This is done using a concept called allometric scaling.
Article A simple practice guide for dose conversion between animals and human
While allometric scaling is very useful, we do need to note that allometric scaling is done mainly via dosing by weight and may not account for the species differences in metabolism and clearance
This is quite difficult. The anatomy of digestive tract of animals differ as in ruminants, fish medicine is altogether different and the metabolism of the young animals differ from adult ones. I can think of only worm treatment where weight to weight basis dose could be adopted since in this instance the drug acts on the worms.