Is it possible to charge an ebike from a 12V solar powered battery?
You can charge it, but you probably won't do as well as you think. You're on the right track but you're missing a couple of things:


Solar panel ratings: These are optimistic and assume full sun hitting the panel at a good angle. Here's the maths.  You won't get that all day, so don't expect to get as much as you would by multiplying the number of hours sunlight by the panel wattage.  12 Hours full sunlight would naively give 1800Wh, but hopefully you're out riding and not adjusting the panel every few hours, and anyway as the sun gets lower in the sky it gives you less power because the atmosphere absorbs some.
Solar regulator: For a panel that big you really should have a regulator.  Some (linear) are quite wasteful.  Switching regulators are better, and can load the panel at its maximum power point for best efficiency.
12V battery behaviour: a lead-acid battery, even a deep discharge one,  won't last for long if you drain it regularly.  You've probably got about 600Wh accessible without shortening the life.  However that means you don't need to produce 1200Wh/day.
Round trip efficiency:  Every step is inefficient - charging the 12V battery, discharging the 12V battery, converting  12V DC to 220V AC, converting 220V AC to 36VDC (or similar) for the battery, and charging the bike battery (also discharging the bike battery but that's not specific to this case of limited solar power).
Other uses: I mostly plug my campervan in to the mains on a big campsite, but occasionally use a solar-charged battery for the fridge and lights.  If you do the same, you'll be eating in to your battery capacity, and (slightly more efficiently) diverting some of your panel's output from charging the battery.  You may of course have a dedicated panel and battery for the bike.


You'd need to choose an inverter based on the input specifications of the bike battery charger, with a little margin.  Don't over-spec it too much though as efficiency will suffer - unless of course you want to run higher-powered things off it occasionally.

As for the bike battery capacity, 500Wh means 500W for 1h, 250W for 2h, 100W for 5h etc.  In practice though, it will be more efficient at lower power outputs.  Most e-bikes are rated to 250W because that's a legal limit in many countries (e.g. all of the EU for standard road-legal e-bikes) so you could run flat out for only 2h, but run with a little motor assistance for much longer.  Hopefully you won't drain that completely, though it's not as bad for Li-ion batteries as it is for lead-acid.  If you were camping at the top of a hill you'd certainly regret using too much as the available assistance reduces as the battery gets low.

There are too many unknowns to calculate properly, but I reckon you'd be close to getting a charge of the bike battery per fully sunny day, but not quite there.  You'd want to monitor the state of charge of your 12V battery.  If you move the camper every few days, as I do, you may be able to charge your 12V battery from the engine to ensure it's fully topped up on a day when you're driving and not riding.  You should also make sure it's full before you leave home (if you're  in the van for months on end that won't make much difference).

Think about how much you rely on the bike - how stuck would you be if you had a few consecutive days of bad weather?