How can octopus walk if muscles can only contract?
Kier and Smith wrote a paper on how tongues tentacles and trunks worked. It explains in detail exactly how their legs (and our tongues) elongate, shorten and move about without any bones for support. It's called muscular-hydrostat. 

Movement of the limb actually depends on which muscle is being contracted. If it's contracting the muscles longitudinally it will make the limb short and wide, while if it contracts laterally it will cause the limb to extend and be short and thin. 

If you watch the video carefully you can actually see the changes in thickness of the limbs as the lateral muscles release and the longitudinal muscles contract so the octopus can move its leg forward. 

If you want to see it work in person, go into the bathroom and move your tongue around and watch in the mirror. It uses the same mechanics to move your food around your mouth, lick your teeth, help you get that bit of food that is stuck up against your gum, and who can forget rolling the tongue into a cylinder or making tongue clovers.