Dogs like to scratch the inside of their necks because they feel itchy. The skin inside the neck is very tender and prone to itching. Scratching it will make it feel better.
It may also be that the dog wants to clean himself up. Dogs love to lick themselves, especially in hard-to-reach places. Scratching the inside of the neck is where they can't lick. Scratching can help clean it. Sometimes dogs will scratch their necks to get their owner's attention. This may be because they need to go out for a walk, meal, or play time. No matter what the reason is, as long as your dog is not scratching excessively, there is no need to worry too much. If your dog is scratching too frequently or exhibiting other unusual behaviors, it's a good idea to visit your veterinarian to determine if there is a medical problem.