If you hit O whilst dead, no commander chat input comes up and you cannot send any commander messages to your team.
HOWEVER, I was typing a message in commander chat, got headshotted, and the text popped up right after my death in the log. I essentially hit enter as I died, so unless it was literally a tie and the game goofed (unlikely) I think that if you hit O and die, then you can complete your message to your team. I asked if they could see that message or not... and they could indeed see the message I sent after death.