They cant.
People here are confusing consent with enjoyment of an act, it is not the same thing.
Consent involves more than a simple interest in sex and pleasure during the act. Consent involves understanding and an accepting of the risks involved.
When two humans consent they are accepting the risks of things like pregnancy and STDs.
You cannot explain and make an animal understand the risks of things like false pregnancy, pyometra, or zoonotic diseases, they cannot consent and accept those risks, all the power for the partners care is left to only one party and that is not consent.
However, animals absolutely can enjoy sex and seek it out, it can improve the bond between animal and human when the human takes proper care to do so. There are far worse things done to animals without their consent that society has said is ok, like butchering them for food, forcing them to breed, etc.