Thank you for posting this in Microsoft Q&A.
If the "Users can create Microsoft 365 groups" setting is set to "No", then users will not be able to create Microsoft 365 groups in Azure portals, API, or PowerShell.
NOTE: If you had a service principal with permissions to create groups, even if you set these settings to No, the service principal can still create groups.
Can a group with create group permissions then create groups?
If users have one of the following roles: Groups Administrator, User Administrator, Privileged Role Administrator, or Global Administrator, they can create groups in entra even if these settings are set to NO.
For your reference: https://learn.microsoft.com/en-us/entra/identity/users/groups-self-service-management?WT.mc_id=Portal-Microsoft_AAD_IAM#group-settings
Hope this helps. Do let us know if you any further queries.
Thanks,
Navya.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.