I've done it with a triathlon. I was on a road-going MTB, with panniers on the back, back in thedays that I was quite fit. Saw a cyclist up ahead on a TTish bike who was going slower than me (no doubt tired after the swim he'd donebefore) so I just over took, wishing him a "good morning" as I did so, only noticing that he had a number attached to him as I got level. I don't see the harm in this - it's a pubic road, there were cars over taking, etc. If it had been a closed road for the event then fair enough - I'd have kept well out the way.
The weird thing was though, when I got to the next junction, attempting to turn left to continue my route, a marshal jumped out, started shouting and got upset because I was going off the course!
So, I'd agree with Nutty's original comments - public road, I've as much right to be there as they have, and if they get upset by someone who legally and safely overtakes them then perhaps they oughta find themselves a different sport. As it is, the guy that I overtook didn't seem to mind at all.
I've also been on the same road as a road race - resisted the lure of jumping onto theback of the bunch as that would have had the potential to cause problems for the racers. So I just carried on at my own speed as they went past andleft them to it.