The theoretical model of a rough wall in a superconductor with d-wave pairing is studied. The surface roughness is introduced by means of an impurity layer covering the wall and the boundary conditions are derived for the quasiclassical Eilenberger equations at the wall. The angular and spatial structure of the pair potential and the quasiparticle density of states near the wall are calculated self-consistently. It is shown that an isotropic gapless superconducting state is induced within the impurity layer in the regime of extreme roughness. The fine structure in the density of states due to quasiparticle resonances is demonstrated. The model is applied to the description of rough surfaces and interfaces in d-wave superconductors. We calculate the angle-resolved densities of states and critical currents in d-wave Josephson junctions with rough interfaces.