Here's an example of a tensor valued, anisotropic function
H = g(T) = (T\cdot{n\otimes{n}})n\otimes{n}
where n is a fixed unit vector.
Then
g(QTQ^T) = (QTQ^T\cdot{n\otimes{n}})n\otimes{n} = (T \cdot (Q^Tn \otimes Q^Tn)) n\otimes{n}
which is not the same as
Qg(T)Q^T =...