The correct option is
B dog
Nouns are words that name people, things, places,
animals, etc.
Nouns function as the subject, object and so on in a sentence. As a subject it performs an action.
Option A: The word 'dog' names an animal in general. It functions as the subject of the given sentence, performing the action 'barking'.
Hence option A is correct.
Option B: 'Barking' is a verb that expresses an action. It's not a noun and hence B is wrong.
Option C is wrong because B: 'barking' is not a noun.
Option D is wrong because the answer lies in A.