aa[x_] = {{1, 2}, {3, 4}} x
bb[x_] = {x^2, x^3}
D[ a[x].b[x] , x, x] (* for any suitable tensors *)
% /. {a -> aa, b -> bb}