Legal malpractice is a wholly state cause of action, and might be brought in Federal District Court only if there is a basis for jurisdiction.  Diversity jurisdiction is the one most quickly thought of, but in certain circumstances federal question jurisdiction may also apply.  Questions of legal malpractice in a patent representation is one such example.  Here, the case of  Immunocept v. Fulbright & Jaworsky provides a discussion of why it may [and on removal, must] be brought in Federal District Court.  There they say:

"Because the claim scope determination involved in the malpractice claim presents a substantial question of patent law, we conclude that jurisdiction is proper under section 1338."