A legal test can only be done with the consent of the party being tested.
However, for non legal tests, various companies offer home kits in which you can collect different types of samples and ship them for testing,
Here are some types of samples that can be collected for non legal testing for paternity.
You can do a search for "secret dna test " for some more options.
Do remember, it is almost ALWAYS preferable to take the consent of the party being tested in terms of legal / relationship reasons,