The commuting graph [Formula: see text] of a finite group [Formula: see text] has vertex set as [Formula: see text], and any two distinct vertices [Formula: see text] are adjacent if [Formula: see text] and [Formula: see text] commute with each other. In this paper, we first study the perfect codes of [Formula: see text]. We then find the universal adjacency spectra of the join of two regular graphs, join of two regular graphs in which one graph is a union of two regular graphs, and generalized join of regular graphs in terms of adjacency spectra of the constituent graphs and an auxiliary matrix. As a consequence, we obtain the adjacency, Laplacian, signless Laplacian, and Seidel spectra of the above graph operations. As an application of the results obtained, we calculate the adjacency, Laplacian, signless Laplacian, and Seidel spectra of [Formula: see text] for [Formula: see text], where [Formula: see text] is the dihedral group, [Formula: see text] is the dicyclic group and [Formula: see text] is the semidihedral group. Moreover, we provide the exact value of the spectral radius of the adjacency, Laplacian, signless Laplacian, and Seidel matrix of [Formula: see text] for [Formula: see text]. Some of the theorems published in [F. Ali and Y. Li, The connectivity and the spectral radius of commuting graphs on certain finite groups, Linear Multilinear Algebra 69 (2019) 1–14; T. Cheng, M. Dehmer, F. Emmert-Streib, Y. Li and W. Liu, Properties of commuting graphs over semidihedral groups, Symmetry 13(1) (2021) 103] can be deduced as corollaries from the theorems obtained in this paper.