Can a doctor ask for a random urine sample?

Well, if you think that the urine sample is unnecessary, you can always ask for a chaperone or somebody. If they havent asked what the problem is or they dont know, then no they can't.