You can file for bankruptcy at any time. You will have to show the collection agency proof that the debt has been discharged after bankruptcy is concluded.
Of course you can. By the time people are filing for bankruptcy, most of their bills would have gone to a collection agency just by the whole process of everything.
You absolutely can file for bankruptcy protection after a debt has gone to a collection agency. Most bankruptcies are filed with at least some debt in collection.
Assuming that the debt would otherwise be dischargeable, it can be discharged in a bankruptcy even if it has gone to a collection agency. Indeed, most people do not file for a bankruptcy until many of their debts are in collections.