God never revealed the basis for His distinction between clean and unclean animals
This is an assumption, and it may well be false. All we know is that such a revelation is not recorded in the Bible. In fact, the passage in question can be seen as evidence that God did revealed dietary laws to individuals such as Noah before revealing it to Moses and the Israelites. Because, as you observed, how else would he be able to understand this instruction?
That the distinction between clean and unclean was written in Noah's heart (and by inference, in our hearts) is only one speculative explanation. That God did explicitly reveal it, another. We don't know with absolute certainty, since the Bible is silent on this matter.
That Noah received direct revelation in this matter is plausible in light of the fact he is recorded to have received a substantial amount of direct revelation - all of which, presumably, may not be recorded in its entirety.
Does it mean the understanding of clean and unclean animals is common / written in our hearts?
As we have no certainty about the previous point, you are left to speculation on this point as well. The Bible makes no explicit statement about this question.