  Codes over Galois rings have been studied extensively during the last three
decades. Negacyclic codes over $GR(2^a,m)$ of length $2^s$ have been
characterized: the ring $\mathcal{R}_2(a,m,-1)= \frac{GR(2^a,m)[x]}{\langle
x^{2^s}+1\rangle}$ is a chain ring. Furthermore, these results have been
generalized to $\lambda$-constacyclic codes for any unit $\lambda$ of the form
$4z-1$, $z\in GR(2^a, m)$. In this paper, we study more general cases and
investigate all cases where $\mathcal{R}_p(a,m,\gamma)=
\frac{GR(p^a,m)[x]}{\langle x^{p^s}-\gamma \rangle}$ is a chain ring. In
particular, necessary and sufficient conditions for the ring
$\mathcal{R}_p(a,m,\gamma)$ to be a chain ring are obtained. In addition, by
using this structure we investigate all $\gamma$-constacyclic codes over
$GR(p^a,m)$ when $\mathcal{R}_p(a,m,\gamma)$ is a chain ring. Necessary and
sufficient conditions for the existence of self-orthogonal and self-dual
$\gamma$-constacyclic codes are also provided. Among others, for any prime $p$,
the structure of $\mathcal{R}_p(a,m,\gamma)=\frac{GR(p^a,m)[x]}{\langle
x^{p^s}-\gamma\rangle}$ is used to establish the Hamming and homogeneous
distances of $\gamma$-constacyclic codes.
