Let's just go straight to the $m\times n$ board.
If $n$ is even, start in the bottom left corner. Go up all the way, right 1, down almost all the way (just 1 block from the bottom), right 1, up all the way, and so on. As we are going up at column 1 and we are alternating between up and down, at column $n$ we will be going down. This time go all the way down and then all the way left.
Otherwise if $m$ is even, rotate the rectangle 90 degrees and do the algorithm above.
Otherwise $n$ is odd and $m$ is odd. If we color the board black and white in a checkerboard pattern, each move to an adjacent square will alternate between black and white. In position 1 we are on a black square, so in position $n\cdot m + 1$ we should be on a white square. But in a tour of the board both of those positions should be the bottom left corner and the same color. Thus we cannot tour the board.
EDIT: In the above, $m$ and $n$ should both be greater than 1 (notes Wa Kai). If one of $n$ and $m$ is 1 while the other is greater than $2$, it is obviously impossible. If the other is 2 it is possible (notes Darrel Hoffman).
The case of $1\times1$ might be up for debate, but I would argue that it is impossible. An allowed move is to an adjacent square, so there are no possible moves and thus nothing can happen.