How to write to common chat in Heroes of the storm?
You just can't, it is not implemented.
At the end of the game, you can say "gg", it's the only word you can say in all chat and only at the end of the game. As @Xrylite said, it is an automatic trigger, and it works even if the game says [Allies].
Also, always at the end, your emotes will be visible to everyone ( press y or z to use the emotes )
In short, the only visible messages are emotes, and "gg" only at the end of the game.
Bonus: while writing in chat you can press Tab to speak only with your party or friend.