If I want to say:
One can do one’s homework in the library
Is this correct?
On peut faire ses devoirs à la bibliothèque
On peut faire ses devoirs à la bibliothèque.
is fine and neither formal nor particularly colloquial.
“On” matches “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.
Yes, it is.
The register is not exactly the same though, the english sentence is pretty formal while the French one is more familiar. It wouldn't fit on a sign for example, it's more common in spoken French.