This is one that’s a particular issue on road bikes. They often have very little clearance between the wheels and the bicycle frame, and the wheel and the brake callipers, which means a lot of mudguards won’t fit. Additionally, most road bikes won’t have the threaded eyelets for bolting them to.
Luckily, there’s a huge range of mudguards that are designed to overcome these challenges. Designed either to fit very closely to the wheel or with a shorter length that starts just after the pinch points, these will attach to the frame using special brackets, ties or rubber straps.
The added advantage of these is that they’re a lot easier to take off again if you want to remove them for racing. There’s also no reason why you couldn’t use these guards on other types of bike, so long as they fit the wheel size and tyre width.
The majority of mudguards out there bolt directly onto the bike frame, which means the bike needs to have the right elements built in to allow this. This includes threaded eyelets at the rear of the bike, at the dropout where the wheel fits into the frame and another bolt at the apex of the forks at the front.
Most hybrid bikes will have these elements, but the majority of road bikes and mountain bikes won’t. Luckily, there are a variety of mudguards that clamp onto the frame at either the seat post or the rear stays.