Is this possible when we create the m365 group that time we can restrict the public group or public team creation but user can able to create the private group or private team.
There's no built-in functionality for this. You can restrict the creation of groups/teams altogether, but not limit the type. If you have such requirements, the usual workaround is to block group creation and use a custom workflow instead, where users either submit a request for creating a group/team or are presented with a set of predefined "template" selections.