Aqueous foams are constituted of concentrated gas bubble dispersions in a surfactant solution. Like other complex fluids, such as emulsions or pastes, foam behaves as a viscoelastic solid if the volume fraction of the continuous phase is sufficiently small for the bubble packing to be jammed. The mechanical properties of the foam are due to couplings between processes at a wide range of time and length scales: The ones of the surfactant molecules that are adsorbed to the gas-liquid interfaces, the ones of the bubbles or collective motions at a mesoscopic scale. On the basis of three experiments, we have evidenced the impact of structural disorder and surfactant properties on foam viscoelasticity. We have constructed an oscillatory rheometer to measure the frequency and strain dependent stress response of a bubble monolayer confined between two parallel plates, subjected to an imposed osmotic pressure. We have shown that the relaxation of these model foams are governed by the interfacial shear rheology which we have probed in independent experiments and, we present a quantitative model of this coupling. In a second experiment, we have probed the viscoelastic response of disordered 3D foams. Our results show that, depending on interfacial rigidity, the mechanical loss factor of a foam is described by a scaling law depending on frequency. Its dependence on bubble size and liquid viscosity helps to determine the origin of the dissipation. In our third experiment, we have produced monodispersed ordered foams, subjected to a controlled osmotic pressure. Remarkably, the frequency scaling of their loss factor is similar to the one of disordered foams of the same chemical composition. These results demonstrate that the linear viscoelastic response of foams is not the consequence of disorder on the bubble scale as suggested by several previous theories, and they thus open the way for quantitative models linking the viscoelasticity of the interfaces to that of 3D foams