Warranty will often mention that it's void if you race it. But I don't think the comparison's fair.
Even in circumstances where it isn't literally illegal to ride even a 'budget' motorbike anywhere near full potential, it's still incredibly dangerous for an amateur. You literally can't abuse it like a pro, without likely killing yourself.
Pro-level bicycle? Often no problem. You're less likely to get into trouble at 20mph/30kmh than 120mph/200kmh on a cheap motorbike. Forget about motogp bikes which IRC do 0-300kmh(190mph?) in under 10 seconds.