The first one is only valid if the question is 'What's your favourite animal for eating?' because you can use 'dog' as a shorthand for 'dog meat'. I'm guessing that's not what's being asked.
The second is correct. However, you would usually say 'Dogs are my favourite animal.' Another possibility is 'The dog is my favourite animal', but that would also be uncommon.
If you need to talk about the generalized idea of all dogs, then you say 'the dog', or 'dogs'.