"The book has cows and dogs."
Translation:किताब में गायें और कुत्ते हैं ।
The given English should be something like 'In the book are cats and dogs' or 'there are cats and dogs in the book'.
'has' is misleading, and sounds like it's a hint because it isn't particularly natural sounding English, it should at least and in 'in'. (Which would be frowned upon by style guides, but conversationally acceptable.)
You are right. The subject of both sentences is 'गायें और कुत्ते'.
The usual SOV word order 'गायें और कुत्ते किताब में हैं' means 'Cows and dogs are in the book'.
By changing the word order to 'किताब में गायें और कुत्ते हैं', we are shifting the emphasis on the words and this sentence is closer to 'There are cows and dogs in the book'. In this English sentence too, the subject is still 'cows and dogs' but the emphasis has been shifted due to the expletive construction 'There is..'.
Hindi doesn't use possessives in such situations (Sentences like 'किताब के गायें और कुत्ते हैं' sound unnatural). So, 'किताब में गायें और कुत्ते हैं is also the way to say 'The book has cows and dogs'.