When you say
My favorite animal is a dog
you are stating that some specific dog is your favorite animal.
When you say
My favorite animal is the dog
you are stating that you favor dogs in general over any other type of animal. You could just as well say
My favorite type of animal is the dog.
Now, particularly in speech, not everyone will be careful about the use of the indefinite article, but when the the definite article is used, the intent is almost always to indicate a type or class.
There is no theoretical difference if “animal” is replaced by “animals.” However, it is less likely, at least in American speech, that the definite article will be used to distinguish between specific exemplars and general types. If a native speaker of American English wants to talk about mulriple types, they will far more often say
My favorite types of animal are dogs and horses
than
My favorite animals are the dog and the horse.
In fact, I venture the opinion that the second formulation will sound stilted to American ears.