Whilst threading is a good guess I don't think that is the case.
Early chain driven bikes didn't have freewheels so even if the cog was threaded on (probably not) it would've still unloosen fairly quickly. Even if it was threaded, there existed even back then reverse threads and methods to stop things unthreading.
My guess would be that the first chain driven bikes were RHD just by chance, what the maker chose based on parts or tooling he had or even the way he preferred to draw out his blueprints (bicycle facing right = drive train on the right side) and could've just as easily ended up being LHD. After that people carried on with RHD out of tradition or habit.