The origins of animal roleplay and petplay are probably various and diverse, again depending upon the participants involved.
It is also sometimes used in education, especially physical education, as a way to encourage people to exercise the body in unusual ways, by mimicking various animals.