Do the Transformers like Megatron, Optimus Prime and the like have operating systems? If so, can these extremely advanced Windows/Linux/MacOS etc. be hacked and reprogrammed as is possible with virtually any operating system?
This is addressed in Episode 1 "The Reformatting", Beast Machines, Season 1:
Cheetor: Did I miss something? This is Cybertron, right? Our home planet? I mean, why would our own kind shoot at us?
Rattrap: Heheheh, have ya looked in the mirror lately? Our 'own kind' don't recognize us in these lousy fur coats!
Cheetor: Not a problem. We just need to get to a Regeneration Chamber and debug this transforming glitch!
Rattrap: Hellooo? We're in da MIDDLE OF NOWHERE HERE!
Cheetor: (Feels pain in his servos; glitching continues) AAAGGGHHH!!
Optimus Primal: It's worse than I thought... If we don't Transform out of these Beast Modes soon, our operating systems will shut down... permanently.
-- Optimus Primal, Cheetor & Rattrap discuss about the transformation lock and Cybertron's major changes...
Episode 6 "Home Soil", Beast Machines, Season 2:
Botanica: Megatron's attack shorted out my ship, along with my higher reasoning protocols. My self-preservation circuits must have kicked in.
Optimus Primal: Which is why you were lashing out at us.
Botanica: Fortunately, your reformatting automatically rebooted my primary operating system.
-- Botanica is exhibiting symptoms of Megatron's virus. Optimus Primal reformats her. She recovers consciousness.
Depending on which continuity you're referring to, it's a touch unclear as it's often never explicitly stated either way.
However, we have seen Transformers reprogrammed or controlled remotely.
In The Secret of Omega Supreme, we learn that Megatron has reprogrammed the Constructicons to become Decepticons.
In Beast Machines, we eventually learn that Tankor, Jetstorm, and Thrust are reprogrammed/reformatted Maximals/Predacons.
In the episode Make Tracks, the Decepticons use a radio signal to control humans and Autobots alike.