Animals are adaptable beings. So are humans (since we actually are animals).
You can train your dog not to poop on the floor, can't you? He isn't an "automaton", he learns. Perhaps he can't learn to do Calculus, but then, neither could I. But to say that an animal can only behave based on hard-coded instructions is patently false. They modify their behavior to fit the specific conditions, at least as far as they can.
Not everyone can train a dog.