The jury is still out:
There is plenty of evidence that animals engage in self-destructive behavior. In addition to the beached whales, ducks and dogs have been observed drowning themselves, cows have walked off cliffs, and naked mole rats (like some insects) leave the colony to die when infected with a communicable disease. It’s not clear that any of these behaviors are comparable to human suicide, though, because suicide involves a set of higher-order cognitive abilities.