Observations of the globular clusters NGC 6388 and M 15 were carried out by the H.E.S.S. array of Cherenkov telescopes for a live time of 27.2 and 15.2 hours respectively. No gamma-ray signal is found at the nominal target position of NGC 6388 and M 15. In the primordial formation scenario, globular clusters are formed in a dark matter halo and dark matter could still be present in the baryon-dominated environment of globular clusters. This opens the possibility of observing a dark matter self-annihilation signal. The dark matter content of the globular clusters NGC 6388 and M 15 is modelled taking into account the astrophysical processes that can be expected to influence the dark matter distribution during the evolution of the globular cluster: the adiabatic contraction of dark matter by baryons, the adiabatic growth of a black hole in the dark matter halo and the kinetic heating of dark matter by stars. 95% confidence level exclusion limits on the dark matter particle velocity-weighted annihilation cross section are derived for these dark matter haloes. In the TeV range, the limits on the velocity-weighted annihilation cross section are derived at the 10-25 cm3 s-1 level and a few 10-24 cm3 s-1 for NGC 6388 and M 15 respectively.