While it certainly varies depending on the animal, many animals do indeed sleep standing up, including flamingos, zebras, cows, horses and elephants according to science resource Science World. Some of these animals such as cows and horses can sleep lying down as well.
Flamingos mainly remain in an upright position due to their environment, which tends to be salt flats, Science World notes. Therefore, it makes sense for them to sleep in this position as well.
It's not entirely common for cows to sleep on their feet, but they certainly can. When they lie down though, they tend to experience rapid eye movement or REM sleep according to animal resource Vet Street. The same situation occurs with horses.
For more imposing creatures like elephants, there is actually a benefit to sleeping standing up. By doing so, these animals are better prepared in the case of predator attacks. Instead of wasting precious time clambering to their feet, they're already there and ready to go, Science World notes.
Animals that can sleep standing up tend to possess certain physical features that make it possible to remain upright and still fall asleep. For example, animals like cows and elephants have legs with a type of locking capability to prevent falling, according to Science World. This saves the muscles of the animal, which can relax and aren't strained during sleep.