Come off it. When has Zelda ever had reference to aliens? Its medieval, not Sci-fi.
The obvious explanation (the one which no one wants to hear) is that they are just there because Nintendo wanted to use them as an easter egg. However, I think everything in Zelda, no matter how obscure, has to have some actual explanation. Just because its more fun that way.
A plausible yet ridiculous explanation is just merely that the cow(s) were grazing and fell into one of the holes, then being a cow couldn't climb back out. However, I remember there being one if these cows on top of death mountain, where there is no grass, so I don't see how that explanation could be valid.
Another explanation, is that there is a cow hater in the world of hyrule who gets some form of sadistic delights from trapping cows down holes. Again, incredibly unlikely.
The most believable explanation, is again ridiculous. It is that these are a special breed of cows, who strive in dark dingy areas I.E underground caves. And, therefore, when they are born, they hunt for a hole -or maybe even dig their own,- climb into it, and live happily ever after.