We study the role of the environment on galaxy evolution using a sample of 868 galaxies in the Virgo cluster and in its surrounding regions that are selected from the GALEX Ultraviolet Virgo Cluster Survey (GUViCS) with the purpose of understanding the origin of the red sequence in dense environments. The sample spans a wide range in morphological types (from dwarf ellipticals to Im and BCD) and stellar masses (10^7^<=M_star_<=10^11.5^M_{sun}_). We collected multifrequency data covering the whole electromagnetic spectrum for most of the galaxies, including UV, optical, mid- and far-infrared imaging data, as well as optical and HI spectroscopic data. We first identify the different dynamical substructures that compose the Virgo cluster, and we calculate the local density of galaxies using different methods. We then study the distribution of galaxies belonging to the red sequence, the green valley, and the blue cloud within the different cluster substructures or as a function of galaxy density. Our analysis indicates that all the most massive galaxies M_star_>=10^11^M_{sun}_) are slow rotators and are the dominant galaxies of the different cluster substructures, which are generally associated with a diffuse X-ray emission. They are probably the result of major merging events that occurred at early epochs, as also indicated by their very old stellar populations. Slow rotators of lower stellar mass (10^8.5^<=M_star_<=10^11^M_{sun}_) are also preferentially located within the different high-density substructures of the cluster. Their position in the velocity space indicates that they are virialised within the cluster; thus, they are Virgo members since its formation. They have been shaped by gravitational perturbations occurring within the infalling groups that later form the cluster (pre-processing). On the contrary, low-mass star-forming systems are extremely rare in the inner regions of the Virgo cluster A, where the density of the intergalactic medium is at its maximum. Our ram pressure stripping models consistently indicate that these star-forming systems can be rapidly deprived of their interstellar medium during their interaction with the intergalactic medium. The lack of gas quenches their star-formation activity transforming them into quiescent dwarf ellipticals. This mild transformation does not perturb the kinematic properties of these galaxies, which still have rotation curves typical of star-forming systems.