Most animal lovers and all behaviourists will tell you that you need to gain an animal's consent before petting it, but we judge this through body language and light, brief, touch in an acceptable way before progressing further.
There's a saying, "you can take a horse to water but you can't make it drink" which literally applies to all animals we care for. We give dogs dog food but don't force them to eat it, if a dog or cat doesn't want to eat what you've given them then they won't. So no breach of consent there.
Dogs enjoy walks and gentle training helps them get used to walking on a lead, the same way as children we get used to holding our parents hand when we cross the road.
Cats aren't that different from dogs,you need to learn to read their body language that's all.
When it comes to feeding a baby, we are meeting a primary need for their survival. But equally, we can't force a baby to eat. Babies naturally consent to eating.
There are times in life when we may act without a persons consent and there are laws about when this can be done. For example, a person has the right to refuse medical treatment if they're ill - even if they're dying - and the law states that they can only be forced to undergoing medical treatment without their consent if, after a proper assessment by certain trained professionals, they are judged to not have the mental capacity to consent to treatment.
In the case of young children and animals, their parents/guardians/owners have a responsibility to make the best decision on their behalf because they are deemed to not have the ability to fully consent. However, in practice, childrens views are sought and taken into account as much as possible. Owners of pets will refuse treatment if they believe the medical treatment is causing more pain and stress to their pet and this outweighs the benefits.
For anyone deemed to not be able to consent, we have a responsibility to treat them with respect and work within their wishes as much as possible. We also have a responsibility to do what is best for them. It is not always easy to judge, but this is why those who cannot consent may have medical treatment against their wishes.
In cases where parents disagree about whether their child can wear nail varnish, they have to sort it out between themselves.