If you legally change your name before applying, then yes.
As for changing it on your PR card or COPR, I am not entirely sure. Maybe someone in similar experience can answer that.
However, if you can wait to change the name until you get citizenship, I will recommend that. Later on, changing...