Can I test any frequency with DFT?
Yes, what you've observed is correct:

The $N$-point DFT only "compares" a signal to the set of complex oscillations $e^{j2\pi f n}$ for frequencies $f$ that fit an integer number of times into the DFT length $N$.

Any other frequency will not be mapped "sharply" to a single DFT bin, but will have some energy in the surrounding bins and spectral repetitions.

We use windows on the input signal of a DFT to shape that "bleeding" a bit.

It is very common to increase the "resolution" by having a greater $N$. To do that, you simply take $K&lt;N$ samples of your input, and attach $N-K$ zeros, so that you end up with a vector of $N$ samples. That way, you can have a finer "grid" of frequencies.