In Undertale, when you fight Sans, you are the final boss. A boss usually has higher stats than you (i.e. Tirual, Mettaton, etc.), but Sans has 1 DEF, 1 ATK, and possibly 1 HP. So you are the monster that Sans is fighting. He even gets the first move like the player. He's in the player position. Megalovania is your theme, not his. (On a side note, Frisk's theme is "Fallen Down", Frara's (Frisk x Chara) theme is "Megalovania", and Chara's them is "Once Upon a Time.")