When is it okay to pray that God would prevent something from happening?
God is our Heavenly Father. We are His children. And He invites us to share every burden with Him (1 Peter 5:7). He already knows what is on our hearts. He knows what prayers we have before we say them. There is no need to come trying to hide anything.
So my point is simply: be honest when you pray. Makes no sense to try otherwise. If there is a relationship that looks like it may be toxic, just take that to God.
“Father, You know everything. I don’t. But this relationship looks like trouble, and I don’t want to see someone get hurt in the longterm...”
But remember: everything you pray for, you should ask according to God’s Will. 1 John 5:14 says “And this is the confidence that we have toward him, that if we ask anything according to his will he hears us.” (emphasis mine)
Every single prayer should end there. “...but God, you know what is right and best. So may your will be done, and give me the faith to trust you during this time.” That is yielding to His sovereignty and wisdom.
We pray in reverence and faith. But as far as I can see, no subjects are off limits. No concerns too small. God loves you and wants to commune with you in prayer.
p.s. - God already knows...