Many dogs are afraid of having their nails trimmed either because of a previous bad experience or due to a lack of handling when young. There are ways to help your dog be a willing partner in having their nails trimmed even if they already protest to it being done.
Before starting to trim your dogs nails you will need to have a good understanding of how to do this properly, Dr Aish has written an article on this to help you.
If you have a puppy you can start trimming their nails when you bring them home. Purchase a sharp pair of nail clippers and start with one paw at a time and reward them after each session. Choose a time where your puppy is calm and you will have greater success at this. If you have a particularly wriggly puppy you can ask someone else to feed them as you trim the nails. So long as you are not scaring or hurting your puppy they should develop in to a dog who is comfortable with having their nails trimmed.
A dog who already has serious objections to having their nails trimmed requires another approach. Start off by having the nail clippers in your hand, or sitting next to you, and when your dog looks at them give your dog a treat. Once your dog is not concerned about the clippers you can progress to touching the clippers to your dogs nails (no cutting) and rewarding your dog after each touch. Next comes opening and closing the clippers next to your dogs nails and rewarding after each snip sound. Once your dog is comfortable with this you may progress to one nail trim, just the tiniest snip, and reward.
This process is just the bare bones of helping your dog overcome their fear of nail trimming. If your dog is showing fear at any step you have progressed too quickly and will need to go back a step. Expect it to take several days or weeks at each step, and if you are unsure about what you are doing consult a reputable dog trainer or behaviourst. In the mean time, try to walk your dog on concrete which may provide some natural filing to the nails. Otherwise have your dogs nails trimmed at the vet under sedation and start this process when they come home so you can trim the nails before they become too long again.
Dogs nails can be very sensitive and having them trimmed requires enormous trust in you. So long as you never hurt or frighten your dog when trimming their nails, and always reward them after a session, they will tolerate having their nails trimmed quite well.