They may mean the same thing, or they may be different, depending on the context.
"Anna loves to dance" definitely means that Anna herself dances, and she loves it.
"Anna loves dancing" could mean the same thing. However, it could also mean that Anna loves the art or act of dancing; that is, she appreciates the art of dance, or enjoys watching people dance. This is because "dancing" can be used as a gerund (a verbal noun), which means "the art or act of dancing".