Caveat emptor is for buying privately. As long as there's no wilful misleading, tough luck.
A dealer has many responsibilities, though. The car can be rejected within 30 days for example (e.g. discovering that the inside edges were bald or a horrible knock develops or the CEL comes on) and then for the first 6 months beyond that, the burden of proof of a fault being pre-existing (and therefore the dealer should sort it out) lies with the dealer (i.e. they should generally fix it providing it's with the expected age/condition - a car with 5K on has different standards to an old banger for £250).
Warranties are on top of the dealer responsibilities, optional, and run by loss adjusters who love not to pay out, so make sure you read the fine print.