Car counts as a dwelling if you're not in the driver seat and you don't have your keys on you. At least here.
Also i have never heard of anyone getting busted for that while camping in a spot that's normally for camping and I've had cops come "inspect" our campsite before. I don't doubt that pigs will do it anyway and I'm sure it doesn't apply as nicely to people without homes.
In my state the police will come after you for having a few beers in a state park campground regardless of vehicle, and would likely try to tack on dui as well if given the opportunity. Most people can and do get away with it but one complaint or you pissed off the wrong piggy and they're gonna kick you out, ticket you, turn over your belongings, and god help you if they find anything else (weed, other drugs, anything really)
Only if you have access to your keys. If you throw the keys away or give them to someone else then you're good. At least in my jurisdiction, might be different in other places.