Fix $n$ and $d$ such that $1\leq d\leq n$, and consider $d$ generic matrices $x_1=(x_{1,i,j})\_{1\leq i,j\leq n},\dots,x_{d}=(x_{d,i,j})\_{1\leq i,j\leq n}$ (meaning: consider the polynomial ring $k[X]$ in $dn^2$ variables $x_{i,j,k}$ with $1\leq i\leq d$ and $1\leq j,k\leq n$, and construct the matrices there) There are $d^2$ polinomials $P_{i,j}\in k[X]$ whose vanishing express the fact that the matrix product $x_d\cdot x_d$ is a linear combination of the $x_1,\dots,x_n$, and there is a polynomial $U\in k[X]$ whose vanishing expresses the condition that the unit matrix $1\in M_n(k)$ is a linear combination of $x_1,\dots,x_d$, and there are polynomials whose non-vanishing express that the matrices $x_1,\dots,x_d$ are linearly independent over $k$. It follows that the common zero set $\mathcal S$ of all these polynomials in $k^{dn^2}$ (well, to handle the non-vanishing ones, one needs to add a few more variables, and so on) can be identified with the set of subalgebras of $M_n(k)$ with a chosen basis. It is more or less clear that there is an action of $\mathrm{GL}(d,k)$ on $\mathcal S$, by «change of basis», whose orbits correspond to subalgebras of $M_n(k)$ of dimension $d$. Now, it is not obvious that the quotient $\mathcal S/\mathrm{GL}(d,k)$ is a nice variety... Maybe one can describe the quotient as the subvariety of the Grassmanian of subspaces of $M_n(k)$ of dimnsion $d$ satisfying appropriate conditions, but I cannot see off-hand how to express that a subspace is closed under matrix multiplication in term of its Plücker coordinates, though.