Is it okay to ask my dentist to have lunch with me?

I work in a small town with only 3,000 people and most are at least 30 years older than me but I went to the local dentist the other day and he was around the same age as me! I used to work in the city and I miss being able to eat with other young professionals. I’ve seen him eat lunch alone and I want to ask whether he would like to eat lunch together but I’m not sure if there’s a certain code of ethics and whether we are allowed to separate patient-doctor from being friends. How should I approach/ at all?
Is it okay to ask my dentist to have lunch with me?
Post Opinion