Thank you for the question.
You are correct that letters representing units of measure may be variables or abbreviations depending upon the situation.
When a letter stands in for an unknown value, it is likely a variable. When a letter or letter combination stands for a standardized unit of measure, it is likely an abbreviation.
Some additional discussion of "variable or abbreviation?" can be found in the Provisional Revised Nemeth Course Manual, posted by NFB. I would direct you to Lesson 5, section 5.1.2.
Please post here again if you have follow-up questions.