If you have earned the MD degree, you may use it in non-clinical settings such as academic use. If you are in a clinical setting, you may not use MD unless you hold a license to practice medicine. If you earned a degree other than an MD, you can't use MD either academically or clinically.
This comes up occasionally with FMGs who have earned the MD degree but can't get licensed here in the US who elect to go through PA school and become PAs. They can't use MD in clinical situations because they are not licensed to practice medicine as physicians. If they hold a license to practice as a PA, that's what they sign as in clinical situations. If they published a paper or are in academia, they can use the MD (because it's a degree).