When I inspect a house that seems to have unlicensed work in important systems like siding, plumbing and electrical work I note this in my report. If there is visible defective work, then there may be invisible defective work: certainly a risk to home buyers. In these cases I also suggest that work permits be requested from the sellers. Usually work permits are needed for major structural changes, so they won't always be relevant. However, if work was not done up the the current code at the time of renovation, then the new owners may have to redo it all before they put it on the market again.
Some paid services like Housefax and its competitors accumulate all the public information on a home, including permits pulled and insurance work done. These won't be comprehensive, yet the additional information may be helpful.
Included below are two Washington Post articles on DIY work and its hazards.