In short: If chain comes off with horizontal drops (typical internal gear or single speed) the wheel has to be too far ahead. Try pulling wheel backwards until the chain can be moved <5 mm and tension the wheel properly.
Other possible issues are:
- bent chainring or sprocket
- wheel not installed properly
- failed bearings in hub or bottom bracket
Worn chain is very unlikely. Also broken internal gears don't drop the chain.