So lets try to clear a few concepts up, though Furniture gave you a good answer.
Yes, Officer of the
Day is duties in harbour, alongside or (much more rare, especially these days) when spending extended period at anchor or made to a buoy. Officers and CPO2 of all trades can be in the rotation (though, and someone currently in can chime if this no longer the case, the Chief Engineer, a CPO2, does not stand in the rotation due to his job as CERA potentially requiring him/her to act in that capacity in some emergencies and thus would take him/her away from the OOD duties).
However, and unlike "duties" on a base for instance, you only stand in the OOD rotation after you have completed a series of requirements that show that you have the knowledge to fulfill the duties, been tested before a board and have the confidence of the CO of the ship you serve on. Therefore, all OOD are
qualified for the duty before standing their first watch as OOD. This qualification, however, does not necessarily equate experience, and an inexperienced OOD can (and they do :nod
make mistakes.
Finally, neither the OOD (harbour) nor the OOW (sea) exercise
command. Command is retained by the CO at all time, save when away (and I don't mean home for the week-end, but away on leave or on duty out of area - such as at a conference in Ottawa, etc.) in which case command passes to the XO, but not to the OOD/OOW. The OOD and OOW only have charge of the ship (and sometimes also control) on behalf of the CO, even though they are referred to as the CO's representative.