On peut faire ses devoirs à la bibliothèque.
is fine and neither formal nor particularly colloquial.
On “On” matches "one" meaning“one” here (indefinite pronoun).
Doing homework in the library is allowed.
This sentence shouldn't be confused with:
On peut faire nos devoirs à la bibliothèque.
which is standard spoken French for:
Nous pouvons faire nos devoirs à la bibliothèque.
i.e.:
We can do our homework in the library.