A brown or black dot or streak under a toenail or
fingernail could be a blood clot, fungus infection, or possibly a skin cancer. Hence get it examined under a dermatoscope from a dermatologist.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps.