The most extreme electromagnetic radiation that can be observed is known as very high energy gamma rays (VHE, E>100 GeV). It is the last window open to the Universe, thanks to the development of the Cherenkov telescopes. The extragalactic VHE sky is still nowadays vastly unexplored, only composed of around 80 known sources. The great majority of them are classified as blazars, a type of Active Galactic Nuclei (AGN) whose relativistic jets point in the direction of the Earth boosting their emission. While the observation of the gamma-ray emission is crucial to understand the extreme physical mechanisms taking place at the relativistic jets from blazars, the optical characterization of their host galaxies plays a key role in the study of this extreme cosmological sources. There are mainly three aspects for which optical spectroscopic observations are key. The first one is the distance (redshift) of the target, that can only be derived confidently from the optical emission/absorption spectral features. Gamma rays are absorbed when interacting with the low energy diffuse photon fields (Extragalactic Background Light) in their way to the Earth. Such absorption strongly depends on the distance of the source, and therefore the redshift is key to infer the intrinsic gamma-ray emission. The second item is related to the characteristics of the optical emission lines, as they are a proxy to characterize the Broad Line Region (BLR), which photon field can induce gamma-ray absorption. The last important item is that extreme blazars emission peaks at higher energies, unveiling the host galaxy emission. Therefore, their optical spectrum allow us to probe the stellar population which is typically hidden due to the strong emission from their relativistic jets. In this work, the distance for three VHE gamma-ray blazars have been estimated firmly for the first time. The spectroscopic campaign during different flux states on S4 0954+65 was key to detect the weak emission lines. The continuum emission from the jet typically outshines the host galaxy, making very challenging the detection of spectral features. Therefore, the observation during the jet low flux states is important for the detection of weak spectral features. The stellar population has been also investigated for the VHE blazars TXS 1515−273 and RX J0812.0+0237, in both cases present an old and metallic stellar population, characteristics of giant elliptical galaxies.