A recent all-object spectroscopic survey centred on the Fornax cluster of galaxies has discovered a population of subluminous and extremely compact members, called 'ultra-compact dwarf' (UCD) galaxies. In order to clarify the origin of these objects, we have used self-consistent numerical simulations to study the dynamical evolution a nucleated dwarf galaxy would undergo if orbiting the centre of the Fornax cluster and suffering from its strong tidal gravitational field. We find that the outer stellar components of a nucleated dwarf are removed by the strong tidal field of the cluster, whereas the nucleus manages to survive as a result of its initially compact nature. The developed naked nucleus is found to have physical properties (e.g. size and mass) similar to those observed for UCDs. We also find that although this formation process does not have a strong dependence on the initial total luminosity of the nucleated dwarf, it does depend on the radial density profile of the dark halo in the sense that UCDs are less likely to be formed from dwarfs embedded in dark matter haloes with central 'cuspy' density profiles. Our simulations also suggest that very massive and compact stellar systems can be rapidly and efficiently formed in the central regions of dwarfs through the merging of smaller star clusters. We provide some theoretical predictions on the total number and radial number density profile of UCDs in a cluster and their dependencies on cluster masses.