Yes - it is possible to get melanoma under in a nail bed.
If it grows out with the nail - it is nothing to worry about. It is an injury or something. If the spot does NOT grow out with the nail - get it checked ASAP.
The problem with this, is that toe nails tend to grow very slowly. So, if you have not injured your toe at all and you are concerned, talk to your doctor. If it is a finger nail, you can watch it and make sure a lot easier.
Keep in mind that toenail injuries are not always noticed so if it is your toe nail, you may have injured the nail without realizing it. Also the biopsy for a nail bed is pretty invasive. They will take a punch out of your nail down to the nail bed.
Hopefully you can watch it and make sure it is moving with the nail itself. Keep us posted.