australia
It's dishonest. Dishonesty is not, in general, illegal.
Dishonesty is illegal when it is used to obtain someone else's property or financial advantage through fraud. It's also illegal if it's part of a statement made when applying for an authorisation or benefit.
It's potentially misleading. Misleading people is not, in general, illegal.
Misleading is illegal when it takes place in trade or commerce.
It gives you a title you don't hold. Claiming a title you don't hold is not, in general, illegal
Claiming a title you don't hold is illegal if it is a protected title under Australian law. For example, there are protected titles under the National Health Practionioners Registration Scheme: "medical practitioner" is a protected title; "doctor" isn't. Further, holding yourself out to be able to practice in certain professions when you are not (e.g. law, engineering in some states etc.) is illegal.
Context matters
Putting on a white gown, wearing a stethoscope and calling yourself "doctor" when attending a fancy dress party is not illegal. Doing it to angle for a free upgrade on your airline ticket is.