Can I correct a mistake that the reviewers didn't spot in a paper that has not been accepted yet?
YES.  The responsibility for correctness of the paper is yours not the reviewers’.  The reviewers may help you find errors, but that is secondary to their main function: recommending to the editor whether to publish.