We have identified two channels for the formation of compact dwarf galaxies in the Illustris simulation by reconstructing mass and distance histories of candidates located in the vicinity of the simulations most massive cluster galaxies. One channel is tidal stripping of Milky Way mass galaxies that form outside of clusters and eventually sink into them, spiraling in toward central massive objects. Second channel of formation is an in-situ formation (in reference to the parent cluster) of dwarf mass galaxies, with negligible evolution and limited change in stellar mass. We find 19 compact dwarf galaxies at the centers of 14 clusters, consistent with observations. 30% of them have external origin while 70% are formed in-situ.