Let's imagine a website that deals with cars: www.cars.com
In order to categorize his website, the webmaster decides to create subdomains for the most famous brands:
Would it be legit?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
If you want a real answer, talk to a lawyer.
That said, your example isn't all that imaginary. cars.com already uses car brands in URLs, as directories. There's no obvious reason to think using them as sub-domains would be a special situation worth suing over versus directories. If anything, the trademark holders should sue for both just to be sure.
Trademark is subject to fair use. (At least in the US. Your particular locale may not even have such a concept. Talk to a lawyer.) If you're running a site that lets people search for cars, some of which may be Fords, it's perfectly reasonable to present a list of them via something like example.com/ford
Even a rudimentary understanding of URL structure would tell anyone that neither ford.example.com nor example.com/ford are pretending to be Ford(.com).
Note that intentionally creating such confusion, eg. typosquatting often can be challenged, either through actual legal proceedings or things like the domain name dispute process.
Also note that some companies/industries may be more or less likely to go after people using their names, at differing scales of "possibly infringing" so: talk to a lawyer if you're really concerned about this. Even if you're in the right, some companies with an army of lawyers are willing to just wait until you run out of money and/or just give up.