There's very little hiking to be done from one's campsite in YNP. You can camp at Canyon and do some hiking there. Likewise, camping at Norris puts you within walking distance of the Norris Geyser Basin and Mammoth puts you close to the Terraces. (When I say close, you're still potentially talking about 10 to 15 mile days including the trails). But to visit places like the Upper and Lower Geyser Basins (must sees IHHO), it's over 15 miles to the nearest CG. So either you'll need to drive or get a bicycle and get to the trailheads that way.
At the Tetons, there is some hiking out of Coulter Bay, but the best hiking and largest selection of trails is out of the area around Jenny Lake. Tents only at Jenny Lake. Vehicles restricted to less than 14'. Enforced pretty stringently.
Again, think about getting a bicycle for your "commuter" vehicle.