If it was a new car, why not? The warrantee is from the manufacturer, not the dealer.
Usually, however, new cars have to be sold by licensed dealers, and licenses are only normally issued to dealers with a showroom and parking facilities. It is a pretty rigorous process getting a dealership license.
OTOH, used cars are a more difficult subject. No matter what you do, unless you have it checked out throughly by a service person you can trust, your taking a chance, and even then, there are no guarantees. I've been both lucky and unlucky, but lucky more often as I've spent many years in the automotive service and sales industry. Besides, I have spent many many hours on my back underneath family autos.
