That depends on which rules for the Universal Translator you're following. Captain Kirk had his own explanation in TOS 2x02, Metamorphosis. From the Universal Translator page on Memory Alpha:
In 2267, Captain Kirk and Commander Spock of the USS Enterprise modified one to communicate with the alien known as the Companion in the Gamma Canaris region. Responding to Zefram Cochrane's question about the theory of operation, Kirk explained that there are certain universal ideas and concepts common to all intelligent life, and that the translator compared the frequencies of brainwave patterns, selected those ideas it recognized, and provided the necessary grammar. Kirk further explained that the device spoke with a voice, or the approximation of one, that corresponded to the identity concepts it recognized. The Companion was revealed to be female because the universal translator detected this facet of its identity from its brainwave patterns, and assigned it a female voice.
Concepts of size would indeed seem to be universal to me. You can imagine something a yard long, without knowing the word "yard". Likewise for volume. The UT would simply have to know the size and terminology for the language it is translating to.
Temperature, on the other hand, is far more ambiguous. I have no explanation for that, honestly, and I'm not sure there is one.
This explanation of the Universal Translator does not come up again, as far as I know. All subsequent series, including the prequel Enterprise, use the more standard "patterns in the language" version.
We can, however, accept a version of this, based on Betazoid telempathy: They can't sense the thoughts of certain species, due to their brain structure. Likewise, Kirk was probably wrong in that "universal ideas and concepts" aren't actually universal in all species. Nor would it work from a recording. The standard explanation used in TNG/DS9/VOY/ENT could maaaybe be a fallback that works on a much, much larger set of circumstances, in that case.
Personally, I do not like this explanation; buthaving such mind-reading technology opens up a lot of plot holes elsewhere and a dystopian nature to the Federation where it's an everyday occurrence. But it is based in canon and is the only thing I can think of..