I have done it but I don’t recommend it. The bag I have is from brewinabag.com and is designed to be safe for boil. I wanted to use the bag as a spider and it worked for that, but the bubbles from the boil pushed the bag up constantly. The bag was bubbling up and folding over and hops were crawling up the sides of the bag and not staying in the wort. The beer turned out fine, so no real loss, but it was annoying. Lately, I sanitize the bag and just pour the wort through it to remove the hop matter. That works okay, but not great. The filter part works but the hops slow the flow through the bag which adds a few minutes to the transfer from kettle to fermenter at a time when the wort temp is cool and susceptible to infection.
I bought a 400 micron bag for this. I found my other 200 micron bag clogged and drained really slow due to the hops in the bag.
One last thing, neither the 200 or 400 micron bag filters hot and cold break material. That flows right through. The bags just filter hops.