The theory of the linear coupling between the ordinary and extraordinary electron cyclotron waves in the vicinity of the plasma cut-off has been generalized for configurations with harmonic perturbations of plasma density, which is relevant, in particular, to the magnetic flux fluctuations in a toroidal fusion experiment. It is shown that for a large aspect ratio, tokamak fluctuations result in the amplitude and phase distortion of the quasi-optical beam on its way towards the coupling region located near the cut-off layer, but have no essential influence on the efficiency of the mode interaction inside the coupling region. However, this may not be valid in a spherical tokamak, where the perturbations may be significant inside the coupling region. We find that density fluctuations cannot be fully responsible for a low efficiency of the OXB heating of the overdense plasma observed in the present-day experiments.