We develop a self-consistent approach for calculating the local impedance at a rough surface of a chiral $p$-wave superconductor. Using the quasiclassical Eilenberger-Larkin-Ovchinnikov formalism, we numerically find the pair potential, pairing functions, and the surface density of states taking into account diffusive electronic scattering at the surface. The obtained solutions are then employed for studying the local complex conductivity and surface impedance in the broad range of microwave frequencies (ranging from subgap to above-gap values). We identify anomalous features of the surface impedance caused by generation of odd-frequency superconductivity at the surface. The results are compared with experimental data for Sr$_2$RuO$_4$ and provide a microscopic explanation of the phenomenological two-fluid model suggested earlier to explain anomalous features of the microwave response in this material.