It’s highly illegal/unethical, but those dealerships play the odds that you don’t know it’s illegal and won’t call the police.
For every story of someone knowing their rights, there’s a few more that get suckered into unfavorable terms because they think the dealership is being upfront and honest with them.