In order to study the mechanism of the formation of cD galaxies, we search for possible dependencies between the K-band luminosity of cD galaxies and the parameters of their host clusters which we select to have a dominant cD galaxy, corresponding to a cluster morphology of Bautz–Morgan type I (BM I). As a comparison sample we use cD galaxies in clusters where they are not dominant, which we define here as non-BM I (NBMI) type clusters. We find that for 71 BM I clusters the absolute K-band luminosity of cD galaxies depends on the cluster richness, but less strongly on the cluster velocity dispersion. Meanwhile, for 35 NBMI clusters the correlation between cD luminosity and cluster richness is weaker, and is absent between cD luminosity and velocity dispersion. In addition, we find that the luminosity of the cD galaxy hosted in BM I clusters tends to increase with the cD's peculiar velocity with respect to the cluster mean velocity. In contrast, for NBMI clusters the cD luminosity decreases with increasing peculiar velocity. Also, the X-ray luminosity of BM I clusters depends on the cluster velocity dispersion, while in NBMI clusters such a correlation is absent. These findings favour the cannibalism scenario for the formation of cD galaxies. We suggest that cD galaxies in clusters of BM I type were formed and evolved preferentially in one and the same cluster. In contrast, cD galaxies in NBMI-type clusters were either originally formed in clusters that later merged with groups or clusters to form the current cluster, or are now in the process of merging.