The given system is
$x+y+z=1$
$x+2y+4z=a$
$x+4y+10z=a^2$
Its augmented matrix is
$\left[\begin{array}{ccc|c}
1&1&1&1\\
1&2&4&a\\
1&4&10&a^2
\end{array}\right]$
Apply the row operations
$R_2 \to R_2-R_1,\qquad R_3 \to R_3-R_1$
Then we get
$\left[\begin{array}{ccc|c}
1&1&1&1\\
0&1&3&a-1\\
0&3&9&a^2-1
\end{array}\right]$
Now apply
$R_3 \to R_3-3R_2$
So,
$\left[\begin{array}{ccc|c}
1&1&1&1\\
0&1&3&a-1\\
0&0&0&a^2-1-3(a-1)
\end{array}\right]$
Simplifying the last entry,
$a^2-1-3a+3=a^2-3a+2=(a-1)(a-2)$
Hence,
$\left[\begin{array}{ccc|c}
1&1&1&1\\
0&1&3&a-1\\
0&0&0&(a-1)(a-2)
\end{array}\right]$
For the system to have a solution, the last row must not be of the form
$[0\ \ 0\ \ 0\ |\ \text{non-zero}]$
So we need
$(a-1)(a-2)=0$
Therefore,
$a=1$ or $a=2$
Hence, the correct option is $D$.