Once a template has been bound to a topic, running Validation will validate the template.
When the template uses Dust markup, the Template is validated for correct Big Faceless Organization (BFO) syntax. Templates containing DUST markup have the ability to dynamically generate BFO syntax based on runtime data. In this case, in order to pass validation you may need to supply sample data.
On the Templates page, in the Template Media Test Datas section, you can upload your sample data. You will not always need sample data uploaded to successfully validate.

Below is a simple example where sample data is necessary to successfully validate this template.
We have a template that looks as follows:
<?xml version="1.0"?>
<pdf>
<body background-color="yellow" font-size="18">
{#__data.people}
{name}
{/__data.people}
...
</body>
</pdf>
... represents code omitted for brevity
Here is the template tab with the template added.

There is a data function that this template uses that looks as follows:
function testFunction(runtime, eventName, params) {
var people = [
{
"name" : "Garry"
},
{
"name" : "Barry"
},
{
"name" : "Larry"
}
];
Providers.getNotificationProvider().setData('people', people);
}
Here is the Topic tab with the template bound and the script above uploaded.

If you try to validate at this time, you will get the following error:

If you upload your test data, it should then validate. The test data looks as follows:
{
"people" : [
{
"name" : "Garry"
},
{
"name" : "Barry"
},
{
"name" : "Larry"
}
]
}

Now when you validate, there are no validation errors. Before the test data was uploaded, the validator did not understand __data.people.name since it was only defined in the javascript function.