The dipole excitations for calcium and zirconium isotopes are studied within the fully selfconsistent Hartree-Fock mean field incorporated with the renormalized random-phase approximation (RRPA) using the Skyrme interaction SLy5. The RRPA takes into account the effect of ground-state correlations beyond RPA owing to the Pauli principle between the particle-hole pairs that form the RPA excitations as well as the correlations due to the particle-particle and hole-hole transitions, whose effects are treated here in an effective way. By comparing the RPA results with the RRPA ones, which are obtained for isoscalar (IS) and isovector (IV) dipole excitations in 48,52,58 Ca and 90,96,110 Zr, it is shown that ground-state correlations beyond the RPA reduce the IS transition strengths. They also shift up the energy of the lowest IV dipole state and slightly push down the peak energy of the IV giant dipole resonance. As the result, the energy-weighted sums of strengths of both IS and IV modes decrease, causing the violation of the corresponding energyweight sum rules (EWSR). It is shown that this sum rule violation can be eliminated by taking into account the contribution of the particle-particle and hole-hole excitations together with the particle-hole ones in a simple and perturbative way. Consequently, the ratio of the energy-weighted sum of strengths of the pygmy dipole resonance to that of the giant dipole resonance increases.