Sometimes.
As noted above, there are clauses placed in individual contracts in an attempt to limit injury.
The UCI (pro cycling sanctioning body) also prohibits the top-tier cyclists from racing in events that lack a UCI sanction.
This has been a large problem in US pro-mountain biking, as most long-distance races are not UCI sanctioned. In theory, pro racers wishing to participate in these events risk fines.