Hello,
In German you can exchange the Dativ and Nominative (Subject)
Originally or normally you would say
“Die Wurst gefällt dem Hund.”
But then you can say also:
“Dem Hund gefällt die Wurst.”
Or as a question:
“Gefällt die Wurst dem Hund?”
and
“Gefällt dem Hund die Wurst!”
The subject is always in the nominative.
Not the place in the sentence shows the subject but if it’s in the nominative.