Under what circumstances is $a^Txa=a^Tax$? Let $a \in R^n$ and $x \in R^n$. $x \in R^n$ means $x$ is a $n*1$ vector.
Under what circumstances is $(a^Tx)a=(a^Ta)x$? When am I allowed to say that? 

These two are vectors, so the equality implies that $a, x$ are parallel to each other. So 
$$\tag{1} a = cx \ \ \text{or }\ \ x =ca.$$
On the other hand, if $(1)$ holds, then (for example if $x = ca$)
$$a^T xa = a^T(ca) a = a^T a (ca) = a^T a x.$$
So to conclude: The stated equality holds if and only if $a, x$ are parallel to each other. 
