Well the drivers license thing is actually a good analogy.
See it actually isn't illegal to drive a car without a license. You just can't drive it on the governments highway without a license. I grew up on 300 acres in rural North Carolina. As a 12 year old, I drove the heck out of that raggedy old jeep, all over the place. To the river and back, down the trails in the woods, across the fields. And it was legal. But the minute I drove my jeep out onto the state-owned road, I was "driving without a license" and might get a ticket. We had a racetrack in Johnston County. It was privately owned. Anybody could drive a car on that racetrack without a DL if you paid for the thrill.
Dive cert is like that. At least here in the U.S. there isn't any law that says you must have a C-card to dive. Now if you want to rent the dive shops gear, or have the dive shop fill your cylinders, or ride the dive shops boat to the dive site, then the established "industry standard" (and probably the shops insurance company) says you have to provide proof of certification. Now the dive shop will sell you one of everything in the dive shop without seeing a C-card, up until your credit card is declined. They just won't rent it to you without a C-card.
But if you were dumb enough to do it, you could buy all your gear, buy a boat, buy a compressor, fill your tanks, and go dive, and there's no law in the U.S. that says you have to be certified. Now there's some ordinances in the State Parks and local municipalities that might say you have to be certified to dive. But generally, there's no law that requires it.
In 16 years I've never been asked for a C-card by any law enforcement. I've been asked for my fishing license by the Marine Patrol while spearfishing, but he didn't car one bit to see a C-card.