Of course you can! Every dashboard on Azure has an underlying JSON representation.
For example:

As seen in the above screenshot, there are options to Download and Clone the dashboard, that'll help with easier manipulation. Note that you can fetch the JSON representation from the Resource Explorer as well.
The next step is to create a template from this JSON so that it can be reused programmatically with the appropriate resource management APIs, command-line tools, or within the portal. It's not necessary to fully understand the dashboard JSON structure to create a template. ;)
Azure offers the ability to orchestrate the deployment of multiple resources via a template-based deployment system. You create a deployment template that expresses the set of resources to deploy as well as the relationships between them.
Once you have crafted your template you can deploy it using the REST APIs, PowerShell, Azure CLI, or the portal’s template deployment page.
For detailed information on how all of this can be done, please take a look at this doc.
Hope this helps!