What is the biblical basis for it being acceptable to bring doubts to God? What is the biblical basis for the idea that it's okay to bring any doubts to God in prayer?
Yes, this is acceptable. It is not only in prayers and not only in the Old Testament but in the New Testament too.

It is important to see that Jesus himself endorses a critical stance.

Thomas the Apostle speaks (John, 20, 25):


  "I won't believe it unless I see the nail wounds in his hands, put my fingers into them, and place my hand into the wound in his side.


Jesus endorses this attitude and bothers to get back to Thomas to give him proof (John, 20, 27):


  Then he said to Thomas, “Put your finger here, and look at my hands. Put your hand into the wound in my side. Don’t be faithless any longer. Believe!


And finally (John, 20, 29):


  Then Jesus told him, “You believe because you have seen me.


So the Bible makes it very clear that Jesus wants us to not just be gullible but to demand proof. Neither of the Apostles was prepared to believe without a proof and Jesus respected that and had this very story been incorporated into the Bible for us.