Mattermost is an open source alternative to proprietary SaaS messaging and you're welcome to modify it as you wish under its open source licenses.
If you're offering a modified version to others, you need to remove the Mattermost brand, since the brand is trademarked.