Can any program be implemented mechanically?
Yes, it is. Here's how you do it: 

You can compile basically any program you like to circuits. See for instance the work of Dan Ghica and his collaborators on the Geometry of Synthesis, which shows how to compile programs into circuits.


Dan R. Ghica. Geometry of Synthesis: A structured approach to VLSI design
Dan R. Ghica, Alex Smith. Geometry of Synthesis II: From Games to Delay-Insensitive Circuits  
Dan R. Ghica, Alex Smith. Geometry of Synthesis III: Resource management through type inference.
Dan R. Ghica, Alex Smith, Satnam Singh. Geometry of synthesis IV: compiling affine recursion into static hardware. 


Circuits then turn out to reappear over and over in engineering. John Baez gives a big table of analogies of concepts, and works out a lot of connections, in This Week's Finds 288-296. So the circuit diagrams Dan's compiler generates could be instantiated as mechanical or hydraulic systems, if you really wanted to! 

╔══════════════════════════════════════════════════════════════╗
║                 displacement  flow      momentum     effort  ║
╠══════════════════════════════════════════════════════════════╣
║ Mechanics      position      velocity  momentum     force    ║
║ (translation)                                                ║
║                                                              ║
║ Mechanics      angle         angular   angular      torque   ║
║ (rotation)                   velocity  momentum              ║
║                                                              ║
║ Electronics    charge        current   flux         voltage  ║
║                                        linkage               ║
║                                                              ║
║ Hydraulics     volume        flow      pressure     pressure ║
║                                        momentum              ║
╚══════════════════════════════════════════════════════════════╝



http://math.ucr.edu/home/baez/week288.html
http://math.ucr.edu/home/baez/week289.html
http://math.ucr.edu/home/baez/week290.html
http://math.ucr.edu/home/baez/week291.html 
http://math.ucr.edu/home/baez/week294.html
http://math.ucr.edu/home/baez/week296.html