Is it ok to have unprotected sex for awhile and then put the condom on before cumming?

No. Any unprotected sex for any duration can lead to stds, including oral, vaginal, or anal intercourse. The pre-cum fluid can also result in a pregnancy. I would recommend protected sex at all times.