Yes, you can create a resource group in a template when you deploy the template at the level of your Azure subscription. For an example of creating a resource group and deploying resources, see Resource group and resources.