Basic electro safety 101, never use any device that plugs into the wall socket regardless of how low the output is. Things like the train controller usually reduce the wall voltage down to 12V but if there is any failure of insulation you could potentially get a full jolt.
There are plenty of specific BDSM eletro toys you can buy online and quite honestly you will not get anything like as good a result from any kind of adhoc device. If you do want to dabble without the expense there are several game devices that will give you a good safe shock, "Lighting Reaction" is one that has hand controllers that can easily be adapted for bdsm fun. The shock when used on nipples and genitals is quite good as it is designed for the much higher resistance skin of the hands.
Just a little background of electro play. There are two types of electrical current you can get, alternating or direct current, AC and DC and for shock purposes AC is by far the best.
DC is what you get in batteries, as you know batteries have a + and - on them. This means the current flows one way all the time, when you get a shock from DC it tends to stimulate nerves and muscles in that one way producing a dull, clenching sensation that isn't a "good" type of pain.
AC on the other hand switches back and forth at a specific frequency which produces a much more interesting tingling effect at very low levels.
All the purpose made bdsm shock devices are AC and allow you to vary the voltage and the frequency, often they can be programmed to run specific patterns to sweep up and down through intensity ranges.
TENS units also use AC and are designed for pain relief and muscle toning, the effects are interesting but you may find you quickly exhaust the potential for bdsm fun with them.