Every licensing rule I've seen has also banned you from quoting or bidding the work if you didn't have a current, active license and bond already in place. True, there are many, many laws I have never read.
As much respect as I have for the law, it is also clear to me that it is nearly impossible to comply with every law. It seems that every governmental desk is determined to invent a new rule, extend their reach. Why, your license to do electric work doesn't cover THIS job, or your license in the next town doesn't mean you can get one in THIS town, etc.
Meanwhile, every one of us sees all manner of work that was clearly done 'under the radar.'
We must remember that the original function of the 'sheriff' was to make sure the King got his share- and that government will ALWAYS place thier interests first in line. "Safety" is often just the latest excuse.