© 2016 American Physical Society.Two-photon interference and Hong-Ou-Mandel (HOM) effect are relevant tools for quantum metrology and quantum information processing. In optical coherence tomography, the HOM effect is exploited to achieve high-resolution measurements with the width of the HOM dip being the main parameter. On the other hand, applications like dense coding require high-visibility performance. Here we address high-order dispersion effects in two-photon interference and study, theoretically and experimentally, the dependence of the visibility and the width of the HOM dip on both the pump spectrum and the downconverted photon spectrum. In particular, a spatial light modulator is exploited to experimentally introduce and manipulate a custom phase function to simulate the high-order dispersion effects. Overall, we show that it is possible to effectively introduce high-order dispersion effects on the propagation of photons and also to compensate for such effect. Our results clarify the role of the different dispersion phenomena and pave the way for optimization procedures in quantum technological applications involving PDC photons and optical fibers.