You can put octonions inside a matrix, but this might not be a particularly fruitful thing to do since the octonion algebra is not associative. (So in particular you don't get octonionic Lie algebras or Lie groups.) The trace, for instance, may not have the properties you are familiar with.

That being said, my only experience with octonionic matrices is the 27-dimensional exceptional Jordan algebra, described for example here. It consists of $3\times 3$ hermitian octonionic matrices and the Jordan product is given by the symmetrised product.