It completely depends on whether the ship has sailed, or not.
But seiously, yes, you can. They will warn you with a back-on-board time.
Depending on crowds in the terminal at the time you return, you may get stuck in some lines trying to re-board.
And, technically, you're not allowed to take anything off the ship as you won't be passing through customs.