Can you tell the difference between sheep and goats?

Literal

Sheep [and-と] goat [possessive-の] distinction [subject-が] understand-[question-か]?

区別 ('distinction / differentiation') takes がわかる ('be understood / clear') — わかる is a 'subject-understanding' verb that takes が for what is understood. Note that の here joins 山羊 to 区別 as possessive 'of' — 'the distinction of sheep and goats.'