n less than the number of samples
Technically yes, but should be smaller than the number of samples. The number of neighbors is the size of the local neighborhood, so if equal to all samples, you are essentially assuming a single neighborhood. In the umap-learn tutorial, they use a range of 2 to a quarter of the total sample size as examples of extremely low and extremely high settings.
If you have a distance matrix of some sort, I recommend that you try affinity propagation..