This is going to be vague but it was a book where a person (forgot the gender) choose to carry out their prison sentence in a tank fighting wars? I don't think they were allowed to leave the tank, except for very specific circumstances. This also took place in a dystopian future where all land wars were fought with tanks like that. The tanks also could keep a person alive without them ever leaving it. The tank it self provided food and life support, etc. The criminals were given a choice to either be in prison or fight for a lesser amount of time though obviously the chance of death was higher.
I think I read it either pre 2000 or early 2000's. I don't think It was Tank Girl since that was a comic.