Wireless networks are increasingly relying on machine learning (ML) paradigms to provide various services at the user level. Yet, it remains impractical for users to offload their collected data set to a cloud server for centrally training their local ML model. Federated learning (FL), which aims to collaboratively train a global ML model by leveraging the distributed wireless computation resources across users without exchanging their local information, is therefore deemed as a promising solution for enabling intelligent wireless networks in the data-driven society of the future. Recently, reconfigurable intelligent metasurfaces (RIMs) have emerged as a revolutionary technology, offering a controllable means for increasing signal diversity and reshaping transmission channels, without implementation constraints traditionally associated with multiantenna systems. In this paper, we present a comprehensive survey of recent works on the applications of FL to RIM-aided communications. We first review the fundamental basis of FL with an emphasis on distributed learning mechanisms, as well as the operating principles of RIMs, including tuning mechanisms, operation modes, and deployment options. We then proceed with an in-depth survey of literature on FL-based approaches recently proposed for the solution of three key interrelated problems in RIM-aided wireless networks, namely: channel estimation (CE), passive beamforming (PBF) and resource allocation (RA). In each case, we illustrate the discussion by introducing an expanded FL (EFL) framework in which only a subset of active users partake in the distributed training process, thereby allowing to reduce transmission overhead. Lastly, we discuss some current challenges and promising research avenues for leveraging the full potential of FL in future RIM-aided extremely large-scale multiple-input-multiple-output (XL-MIMO) networks.