I just tested this on Slack (macOS) and it's not the case. Pressing Enter in a code block submits the message, just as it does for any message.