Here's one way to do it with $1$-dimensional physical quantities for which you can have both positive and negative amounts. The amount of a physical quantity can be represented without units by an oriented $1$-dimensional abstract vector space $V$. The properties of a vector space mirror the assumption that you can add amounts of the same quantity, as well as multiply the amount by any scale factor. The orientation is needed, because presumably there is an observable difference between positive and negative amounts.
Choosing a unit is simply choosing a nonzero vector $u \in V$ and declaring it to be a unit amount. Then any other amount $v \in V$ can be written uniquely as $v = cu$, and therefore consists of $c$ units of the quantity.
If you have a physical quantity that is the product of two other quantities, e.g., area, the compound quantity is represented by a tensor product. If $V$ represents length, then $V\otimes V$ represents length squared, i.e., area. If you choose a unit $u \in V$ for length, then $u\otimes u$ represents a square unit of area.
Then the concept of "per quantity" is modeled by the dual vector space $V^*$. If $u \in V$ a unit quantity, then there is a unique $u^* \in V$ such that $\langle u^*,u\rangle = 1$. $u^*$ represents "per unit quantity"
For example, if $V$ represents distance and $T$ represents time, then speed is represented by $V\otimes T^*$. If you choose units $u \in V$ and $t \in T$, then you get a unit for speed, $u\otimes\tau$, where $\langle \tau,t\rangle = 1$.
A general framework for higher dimensional physical measurements seems more complicated to me. However, if you restrict to space, then things are already well understood. For example, flat space is just an abstract vector space with an inner product, and choosing units is just choosing a basis. Normally, we want the units to be isotropic (use same units in all directions), so the basis is chosen to be orthonormal.
You also sometimes want to use fractional powers of units. This is no problem, because an oriented $1$-dimensional vector space can be raised to any fractional power.
Best Answer
You answer your own question in the third paragraph, the rank is equal to the number of physical dimensions, not units.
In your example, the matrix is $$ \begin{pmatrix} 1 & 1 & 0\\ 1&0&1 \end{pmatrix}$$ (where columns refer to a,b,c and rows to ML and T) which is of rank 2.
M and L are not independent dimensions, with the variables a,b,c you can never get M or L alone. It is as if you are in 3D space but you only have the 2D subspace spanned by (1,1,0) and (0,0,1).
Anyway, the "number of units" is ill defined, because you can usually express any unit in terms of a different number of other units (e.g., 1 sec = 1 Coulomb / 1 Ampère).
So yes, in some sense you "eliminate" variables whose units can be expressed in terms of others - rather than to introduce a new variable. Here you have [a] = MLT = [b][c], so you can "drop" (the units of) a. You can do that by Gaussian elimination on the matrix where you can first write all units individually: e.g., starting with rows M,L,T, you'd have $$ \begin{pmatrix} 1 & 1 & 0\\1 & 1 & 0\\ 1&0&1 \end{pmatrix}$$ Then you eliminate e.g. row 2 (doing R2 <- R2 - R1), and if you discard the empty row, you get the previous matrix. You can track the combinations used by including a unit matrix to the right (but you don't consider that for the rank).