Do you ever do things that are slightly illegal?

I hope this is appropriate to ask on this forum. Do you ever do things to maximize profits that are slightly illegal? For example, one time I rented a shed in someone’s back yard that they had 3 people in. It was an obvious Code Enforcement violation, but we liked it and she liked the rental income. If that is the difference between making a profit and not, it might be worth looking in to.