It's absolutely possible but probably not worth the effort.
I build these types of systems all the time but they're on houses and commercial buildings.
To do this properly you have to have a Net Metering agreement with the power company. They install a bi-directional electric meter. If you were going to be parked at a permanent site all the time you could do that but not if you're moving around from place to place.
Most normal electric meters won't run their count in reverse even if you feed power thru them backward. This is to keep people from flipping their meter over and stealing from the power company. So, even if you decide to try a grid-tie system without the bi-directional meter, any power you push to the grid would actually run your meter forward and you would be billed for the power you gave to the grid.
On a home, depending on state tax incentives, it can take anywhere from 5 to 15 years until you break even. That is, when you've saved enough electricity to pay for the solar system. With a small little system like would be on an RV I suspect this time frame would be even longer.