I think they're pretty much interchangeable.
"Almost" is slightly more formal, so you might want to use it in more formal writing.
But both can be used in conversation.
So I could say "It's nearly/almost midnight" "I have nearly/almost finnished"
and they are all ok