You can target any creature with this spell, including animals. However, if the animal can understand you or not depends on whether the animal would understand you anyway if you spoke normally. You can give a command to your pet as usual with the spell, but if you do that with a wild animal, it will react as if you were talking to it normally, probably fleeing.