The top move will be erased to make room for whatever new move the pokemon wants to learn. And yes, that includes HMs, so if you haven't gotten to the move deleter yet, and you don't want something to know an HM move, let it learn something through the daycare.
It basically just pushes the moves up a space, coming in at the bottom, shoving the top move away.