This is correct, this residual analysis is the classic goodness of fit test for the estimation of Hawkes processes. Formally, consider a univariate Hawkes process $\mathcal{T}:=\{t_i: i\in \mathbb{N}^*\}$. Denote by $\lambda$ the conditional intensity of this Hawkes process, and by $\Lambda$ the compensator of this Hawkes process i.e.$\Lambda(t)=\int_0^t \lambda(t)dt$.
Now define for all $i\in \mathbb{N}^*$, $s_{i}=\Lambda(t_i)$ and consider the point process $\mathcal{S}:=\{s_i: i\in \mathbb{N}^*\}$. Then $\mathcal{S}$ is a standard Poisson process. One way to test that $\mathcal{S}$ is a standard Poisson process is indeed by performing a KS test on the residuals $(s_{i+1}-s_{i})$ since under the null hypothesis they should be exponentially distributed with rate $1$.
This classic result can be found in Theorem 1.20 in the thesis of Linigier (2009), Theorem 7.4.1 in the book of Daley and Vere-Jones (2003), or earlier in section 3.3 in Ogata (1988).
Note that the computation of the residuals of a Hawkes process is expensive in the general case: if $N_T$ jumps are observed, this computation is roughly in $O(N_T^2)$. The generalization of this GOF test to the case of a multidimensonal Hawkes process is straight forward: the time transforms for each dimension of the Hawkes are independent standard Poisson processes.