In some states and places living off grid is legal but in other areas and states living off grid can be illegal and you could get fined or face jail time which is not right but that's the way the world and laws are.
There are a few states that I know of that it's legal to live off grid such as Hawaii, Washington, Oregon, Missouri and Tennessee.
Always check with the local laws though to be sure it's legal in your area to live off grid as you can get into legal trouble.