Most people camp in designated RV or Campsites in Yellowstone but I have seen some people camp in other areas away from those campsites and as far as I know nobody was bothered or told to leave those areas.
As long as you're being quiet and not playing loud music etc you should be just fine camping anywhere inside Yellowstone National Park. .
I've seen some people camping just anywhere in Yellowstone National Park in both tents and Camper Trailers so you could camp anywhere in Yellowstone National Park.
There are also designated RV and Tent sites that you can purchase for an overnight stay and some have electricity and water available and some don't.
To get into Yellowstone National Park you'll need a permit for the park to enter.
When you drive up to go into Yellowstone National Park you'll see a gate with an attendant where you'll need to purchase a pass to enter the Yellowstone National Park.
The Yellowstone National Park pass is $25.00 which is good for a year of entering the Yellowstone National Park.
The park pass allows you to get into both Yellowstone and Grand Teton parks.
Then you can camp in Yellowstone with that park pass and they have campgrounds where you can tent camp or camp in a travel trailer or other RV.
Those campsites range from primitive with no electricity and others have electricity for an extra cost.
I've seen some people just camping away from the campgrounds in their camper trailers or Motorhomes before so I guess you could.
I've never seen anyone get told to move or leave the area.