The enemy pokemon in gyms are ALWAYS computers, never player controlled, even if the owner of the pokemon you're facing is currently training.
I'm pretty proficient in dodging by now.
I discovered how to dodge on my own without outside help, but I can confirm what the creator of this video is talking about.
So when every enemy pokemon attacks, you'll see a flash of yellow light around the edges of the screen, and then you'll get the actual attack like a second later. In order to dodge and receive a fraction of the original damage, swipe sometime after you see the flash, but always before the pokemon completes the attack.
If you face a vaporeon, dodge between the flash and the water that hits you. I can't really tell you when, but its like halfway between these 2 events.
Some pokemon have different events. Nidoking/queen, and Dragonite have atleast 2 different quick attacks. One you have to dodge before you get hit by a blast, and the other you have to dodge immediately before it fully swings its arm at you. Keep in mind to always dodge sometime in between the flash and the attack for QUICK attacks.
For the special attacks, I think you get the flash a little sooner, so dodge after the flash and immediately before you see the enemy pokemon move for its special.
In order to practice this, I recommend fighting weak pokemon in gyms. You can challenge a gym normally, but it will be awkward at first and you'll likely sustain a lot of damage in the learning process. OR you can boot out a rival gym, place one of your pokemon that isn't super strong, and train it with one of your strongest that is battle resistant to it. This way, you are already receiving less damage, and won't have to worry about healing as much.
NOTE: Some pokemon have different motions. Many physical cutting or hitting attacks require the enemy to swing something at you. Dodge right before it completes the swing, but after it begins the swing motion.
Also, you will be told you have successfully dodged by a caption by your pokemon that says Dodged! If there is no such caption, or it displays the Not/Super effective caption, then you did not time it correctly.
AND sometimes its been reported that pokemon battles don't give a flash when using its special move. If that is the case, then take notice of the pokemon's quick attack pattern (It attacks about every 2 seconds), and when you feel the pokemon has remained still for an unusual amount of time, it will use its move. If this is the case, dodge right when you see the special attack animation. This is only an error, so only expect this on rare occasions, and when you battle Vaporeons. Vaporeons are very common