There are a couple of websites if you are looking for convict ancestors who were transported, and we have mentioned one on this blog before. However, if you are looking for criminals who were convicted and hanged, or sent to prison, Black Sheep Ancestors is a good site to try.
There are records for England, Scotland Ireland and Wales, but these are nicely categorized. One of the links will actually take you to a listing of all of the executions that took place in Scotland in either the 19th or 20th century.
Even if you don't have convicts for ancestors, the site is an interesting one to trawl. If nothing else, it shows some very interesting social history.