We know that under H0
one of the summaries (which is a random variable) of this sample has a known distribution. Is it correct to use this summary as a test statistic?
It kind of depends partly on what you mean by "correct".
You can use a statistic whose distribution is known under the null to perform a test of known size; in that sense it will be "correct".
However, unless that summary statistic relates to the hypothesis you're testing, it may make for a useless test (that is, a test can be 'correct' in the sense of having the desired significance level, but be of no practical use).
So for example, under an assumption of normality and given a null hypothesis about the mean, I know the distribution of the sample variance, but it's useless to use it for my test about the mean. You need a statistic that will have a different distribution under the alternative, and specifically, have a rejection region that the test statistic will fall into more often under the alternative than under the null.
Even when the statistic does "relate" to the population quantity (or quantities) in the null, you would want to consider the properties of the resulting test (power, test bias and so on) to assess its suitability, especially where alternative possibilities for test statistics can be identified.
[Note that you don't necessarily need to know the distribution of your test statistic under the null to use it as a test statistic; for example permutation tests or other resampling tests (e.g. bootstrap tests) can often be performed.]