Why does my washing machine shift around while operating?
Yes, your washing machine should be level and all legs should be squarely on the floor.  If it's not, you'll have unbalanced forces acting on it as the drum spins.  During the spin cycle, these forces are much larger because of the higher spin speeds and will make it "walk".

You'll need a spirit level to balance the washer.  There's usually a gap between the top plate and the side plate of the washer that you can rest the level in to measure the front-to-back tilt.  For the side-to-side tilt, generally just put the level on the top of the washer.  You may have lock-nuts on the legs: if so, loosen them with a wrench before trying to adjust the washer, and tighten them afterwards.  Raise or lower the legs until all four are solidly on the floor; the washer should not rock at all.  If you have to move the washer to adjust it, remember to check it once it's back in its place.