In this paper, we study the square of generalized Hamming graphs by the properties of abelian groups, and characterize some isomorphisms between the square of generalized Hamming graphs and the non-complete extended p-sum of complete graphs. As applications, we determine the eigenvalues of the square of some generalized Hamming graphs.