There is no way to be 100% certain of legitimacy but checking that the company exists is a good start (particularly where a company has been around for a number of years and is up to date with its filings).
Other things you can do to check the legitimacy of a company are:
Search the company name and its product on a search engine such as Google. See if it shows up on any sites that have reported the business in a negative context. You may also come across some helpful reviews on blogs or consumer sites (although you still treat these with caution).
Check out the company's website. Look for a professional approach and good English. You may also be able to find some testimonials about the services and products. Also look for an "about us" section to see how long they have been trading and who's behind the business.
Look at any written terms and conditions carefully. Depending on the nature of the product, they may well offer a money back period or no quibble guarantee. If they have faith in their product this may help you in garnering some also. Also check out customer services (if they have one) by ringing the contact number. Ask as many questions as you need to get peace of mind.
Finally, trust your instinct. If you can't get comfortable - walk away.
As I say, there's no fullproof way of determining legitimacy and no "legal" answer to this but hopefully this should help.
I hope this answers your questions. If so, please don't forget to rate my answer so that I can obtain credit for my work.