at the beginning of the season the bikes are all homologated (really closely checked) against the rules for that class (think road, cx etc), and at the end of every race they carefully check the technical for compliance. Of course there are the logistics of lots of bikes to deal with, but I'm sure they could work something out
Who's gonna pay for that tho