A general theory of collective spin wave edge modes in semi-infinite and finite periodic arrays of magnetic nanodots having uniform dynamic magnetization (macrospin approximation) is developed. The theory is formulated using a formalism of multi-vectors of magnetization dynamics, which allows one to study edge modes in arrays having arbitrarily complex primitive cells and lattice structure. The developed formalism can describe spin wave edge modes localized both at the physical edges of the array and at the internal "domain walls" separating the array regions existing in different static magnetization states. Using a perturbation theory, in the framework of the developed formalism it is possible to calculate damping of the edge modes and to describe their excitation by external variable magnetic fields. The theory is illustrated on the following practically important examples: (i) calculation of the FMR absorption in a finite nanodot array having the shape of a right triangle; (ii) calculation of the spectra of nonreciprocal spin wave edge modes, including the modes at the physical edges of an array and modes at the domain walls inside the array; (iii) study of the influence of the domain wall modes on the FMR spectrum of an array existing in a non-ideal chessboard antiferromagnetic ground state.