No, they are two very different things. Doing something illegal is also known as breaking a law, which can be subject to serious punishment back up by governmental premises. Rules are guidelines, less harsh, and little to no punishment come out of breaking them. Don't assume they are the same thing.