Mergers of compact object binaries are one of the most powerful sources of gravitational waves (GWs) in the frequency range of second-generation ground-based gravitational wave detectors (Advanced LIGO and Virgo). Dynamical simulations of young dense star clusters (SCs) indicate that ~27 per cent of all double compact object binaries are members of hierarchical triple systems (HTs). In this paper, we consider 570 HTs composed of three compact objects (black holes or neutron stars) that formed dynamically in N-body simulations of young dense SCs. We simulate them for a Hubble time with a new code based on the Mikkola’s algorithmic regularization scheme, including the 2.5 post-Newtonian term. We find that ~88 per cent of the simulated systems develop Kozai-Lidov (KL) oscillations. KL resonance triggers the merger of the inner binary in three systems (corresponding to 0.5 per cent of the simulated HTs), by increasing the eccentricity of the inner binary. Accounting for KL oscillations leads to an increase of the total expected merger rate by ~50 per cent. All binaries that merge because of KL oscillations were formed by dynamical exchanges (i.e. none is a primordial binary) and have chirp mass >20 Msun. This result might be crucial to interpret the formation channel of the first recently detected GW events.