It depends on your personal history and your family history. If you are prone to moles/lesions or if there's a strong family history of cancer, or if you have had multiple major sunburns in your life, then it may make sense.
I think sometimes dermatologists have an abundance of caution, because early detection is key. Certainly treatment is easier before things advance. On the other hand, some are looking for an annual exam & business increase . I'd ask my primary care doctor, if I were you, whether it's really necessary or if he/she is already checking you and sees any reason for a specialist.
Our regular doctors check us over at our annual physicals. Good hairdressers check the scalp. If anything is suspicious, then yes, you see a dermatologist. My husband tends to get moles, so his dermatologist draws a little "map" on a silhouette of the body (front and back) and indicates where the larger moles are. The moles are measured and then at a subsequent visit then can be checked again for changes. He has had a few removed over the years. But after the last 5 years with zero changes, my husband hasn't been back. He has one now that seems larger to me, so he'll go back in to have that checked, although another doctor has already said it's non-cancerous so we aren't rushing in.