Can you do a kegel exercise while urinating?

No. Your urinary sphincter usually closes during kegel exercises which will have the effect of arresting urination.
Kegel. Performing a kegel exercise during urination is that same thing as squeezing your bottom/pelvic floor muscles to try and stop urinating.