Do some dentist lie to a patient about cavities and unesscary dental work? I know there are a lot of great dentist out there, but some, I worry about.

It's the real world. You may encounter situations in life that may not make sense to you. Same holds for dentistry. If you can't make sense out a diagnosis, then seek another opinion. You may hear the same thing or something different. Ask your friends for a recommendation.
Cavities. I wish you could answer no to this question, unfortunately there are people with questionable practices in all walks of life. If you question the diagnosis you have been given seek out a second opinion to set your mind at ease.
Second opinion. If what you hear from your dentist does not make good sense to you you may wish to get a second or third opinion.
Like everyone else! Just because one holds a dental degree does not mean they have high ethics. There is no difference between general population of workers and dentists. I once heard the following 20-60-20 rule of thumb: 20% of all professionals etc. Will be top notch, 60% are just average, 20% are going to be lousy. Interestingly, it is very difficult for the lay person to know good dentistry. Caveat emptor!
Possible! For the vast majority of dentist, their primary concern is the well being of their patients! just like any group, i'm sure there are a few bad apples, but you can start by asking if you dentist is a member of the american dental association, where it's members promise to uphold the highest standard of ethics. Believe me when i say that there is enough real decay out there without inventing it!