My understanding is that vehicles used for farming are exempt from road use taxes. Some states even have special license plates to identify farm trucks.
I don't know about other states, but in Virginia, the state does not issue "Farm Use" license plates. You can buy them at any farm store and many hardware stores. They are completely unofficial. It's really a big scam. There are plenty of people who just don't register their regular vehicles (typically pickups, but often SUVs) and just put the farm plates on them. There's really no enforcement, because the law is worded so poorly that it would be just a about impossible to prove abuse.
Also, if you are using on-road (taxed) diesel in a farm truck you can deduct the taxed portion of the fuel you use on your federal income taxes. Some states also allow this exemption for state income taxes.
Yes, it's perfectly legal, IF you do the paperwork, which is probably a lot more hassle than it's worth.