Student or Learner
The official name of Dan, Danny is Daniel; then what do we call 'Dan' and 'Danny'? Are they called as nicknames of Daniel?
To answer your question, yes, Daniel is the formal name for Dan and Danny.
They are not considered nicknames, rather they are just shorter common names. Similarly Robert is the formal name for Bob or Bobby. The list is endless.
We usually consider a nickname as a name describing some attribute of a person. A boxer might have the name Ivan (killer) Parker. His friends might refer to him as killer in casual conversation...but it has no legal value. For example he would never sign a legal document using Killer Parker.
However, Dan or Danny might be the name on someone's birth certificate and even if it isn't and their name was Daniel then Dan or Danny could still be used on a legal document.
For myself, my formal name is James but I am known by a less formal name of Jim. I sign ALL my legal documents James *******. I am consistent in this and if any document is signed Jim ******* and someone claims it is signed by me...I can tell them it is a forged document since James is my real name and that is how I sign such documents