Well, a magnet could DEFINITELY change if it gets exposed to heat, because you could melt the metal and change its shape.
If you hit it hard though, it wouldn't make much of a difference because the magnet is metal, so you'll probably just chip it or leave a dent.
Hope this helps ;)