Hey @danilvoe,
The software is open source so you're welcome to fork the code base and modify it, per the open source license in the source code.
We have added more details on our FAQ page for things to consider when you create a derivative work of Mattermost, including security updates and re-branding: https://docs.mattermost.com/overview/faq.html#how-can-i-create-a-derivative-work-of-mattermost-as-my-own-commercial-solution
Let me know if that helps,