Hi KoloskovaMariia and welcome to the Mattermost forums!
Yes, authentication is the same as with other users, depending on your server configuration. If you support multiple authentication types (LDAP, email, etc.) you would need to specify the authentication backend upon user creation. The code snipped you posted will create a user account with email/password authentication.
In order to add users to a Mattermost installation, the user needs to be at least get the team admin permissions so they can send invites or create invite links which others could then use to create their own unprivileged accounts.
User creation using mmctl
is only available for system admins AFAIK.