Yes, you can export the template from a resource group. The exported template is a good starting point for learning about templates, but you'll probably want to revise it before using it in a production environment.
When exporting the template, you can select which resources you want to include in the template.