I have a main branch and if someone wants to create new branch then it must start with feature/*, bugfix/*, release/*.
I tried using branch protection rules, but I couldn't find any settings that prevent the creation of these branches which do not match the pattern.
Is there a way to implement this?
If you wish to protect some central repo you can use pre-commit hooks (see here) for such task. As you can see from here hooks can be client- and server-side. They are in git for a long time and were used in many such situations e.g. in gerrit toolkit. So probably it will not be a big problem to implement some filter based on the name for such hooks. As I know they can be implemented as shell scripts.
So ok, for Github one can use Rulesets feature. Take a look at it.