Rear wheel alignment can cause a chain to come off.
Measure from the swing arm pivot bolt to the rear axle on each side . Both sides should be the same. Ignore the stamped marks on the swing arm.
Check the swing arm bushings too.
The front sprocket or splines cam allow the front drive sprocket to wobble and cause the chain to come off also.