This is a good question, because this figure of speech occurs quite often among English language speakers.
A "nail" in this context is a sharp, pointed metal object that you use to connect boards together, etc. :
http://www.homedepot.com/p/Grip-Rite-11-1-2-x-2-3-8-in-8-Penny-Vinyl-Coated-Steel-Sinker-Nails-1-lb-Pack-8CTDSKR1/202308520
"nailed it" means you got something exactly right, or did something perfectly. You can think of someone trying to hammer a nail into a board. They hit the nail so perfectly that the nail goes straight into the board very well. If you scored 100% on an exam, you "nailed it". It could also mean something bad: suppose you hit and crushed a mailbox with your car. You "nailed" the mailbox.
"got nailed" means you got hit by something or were caught doing something wrong.
To "nail down" something means to get a focused, finished answer to something. For example, you could be uncertain how to reach a CEO of a large corporation. If you somehow got their personal cellphone number, you "nailed down" how to reach them. Also, suppose a person is trying to avoid answering a question. If you "nail down" the person, you conversationally pin the person into a corner so they are forced to answer your question directly and properly. Visually, you can think of a tent blowing in the wind. You "nail down" the tent with spikes to keep it from blowing around or blowing away. It's that idea.
Here are some expressions that illustrate the idea:
"That football kick was awesome... you nailed it!"
"The boxer nailed that guy in face and knocked him out with one punch."
"We really need to nail down our business plans for next year. Right now we are just guessing at things."
"We need to nail Mark down as to whether he plans to buy the car or not. Otherwise, we are going to sell it to someone else."
"The politician got nailed in a bribery investigation and is now going to jail."
"The drunk driver nailed three people on the sidewalk with his car. They are all in the hospital."
"Somebody in our business is stealing. We need to find a way to nail them."