When a lawsuit is filed in Massachusetts and plaintiff is a Mass resident but defendant is Maryland resident can the defendant be issued a subpoena to be deposed in Massachusetts?

Your attorney would be best to answer that questions. Since we do not have the full facts of the case and this place does not provide legal advice since not everyone here is an attorney.
Call your lawyer or Google one for a free consultation.