There is no legal dispersed camping within any National Park, but perfectly legal within almost any National Forest. Both Yellowstone and the Tetons are surrounded by hundreds of thousands of acres of NF, as are most big parks.
Just about every notable park in the nation has been discussed here at with good off-grid camping options near it. Just search around or ask when you are headed in a certain direction.