As the Reddit thread mentioned by @TypeIA states, there are cases of the phrase 'turn off' (and 'turn on') being used in the sense of 'stopping the supply of something to something else' from the early 1800s at least. OED has 1833, but a quick search of Google books takes us back to this 1801 text:
Dr Johnson in the 1755 also included 'turned off' in his dictionary, but not in the sense we're dealing with here, although it certainly did have the sense of 'diverting/distracting something from a course it otherwise would have taken' (most obviously 'turn off the highway', but also 'turn people away from something').
So, before the context of electricity, clearly there was an association between turning a wheel, spigot or stop-cock to cut off a supply of liquid or gas.
However you don't turn a light switch - which was the context in which most people encountered early electricity. Therefore it seems reasonable to hypothesize that 'turn off' arose more from the sense of 'turn off the supply of electricity to the light' than 'physically turn a dial or knob to deactivate the light'.
Given that a supply of electrical 'current' and a supply of water or (electricity's predecessor in the lighting game) gas have some obvious parallels, my guess is that that is how the phrase came to be adopted to mean any shutdown of an electrical apparatus. We still often use that sense, in essence, when we say 'to power off [something]' - the sense here is still more obviously of taking away the supply of power which makes something work.