We present a comprehensive study on the structure and optical properties of Mn-and Co-doped ZnO samples prepared via solid-state reaction method with different dopant concentrations and atmospheres. The samples were structural and chemically characterized via X-ray diffraction, scanning electron microscopy, energy-dispersive X-ray spectroscopy, and X-ray excited photoelectron spectroscopy. The optical characterization was performed via Raman, photoluminescence, and diffuse photoreflectance spectroscopies. Emphasis was done on the studies of their vibrational properties. The structural data confirm the incorporation of Mn and Co ions into the wurtzite ZnO lattice. It is demonstrated that the usual observed additional bands in the Raman spectrum of transitional metal (TM) doped ZnO are related to structural damage, deriving from the doping process, and surface effects. The promoted surface optical phonons (SOP) are of Fr\"ohlich character and, together with the longitudinal optical (LO) polar phonons, are directly dependent on the ZnO electronic structure. The enhancement of SOP and LO modes with TM-doping is explained in terms of nonhomogeneous doping, with the dopants concentrating mainly on the surface of grains, and a resonance effect due to the decrease of the ZnO bandgap promoted by the introduction of the 3d TM levels within the ZnO bandgap. We also discuss the origin of the controversial vibrational mode commonly observed in the Mn-doped ZnO system. It is stated that the observation of the analyzed vibrational properties is a signature of substitutional doping of the ZnO structure with tuning of ZnO optical absorption into the visible range of the electromagnetic spectrum.