"Can I be terminated for having a legal matter outside of work?"
Yes. The only reasons prohibited by law for termination are Title VII reasons: age, race, religion, gender, ethnic background etc. Having a legal issue that the company feels is interfering with work is a legal reason for termination. Get moving with your attorney to get it resolved and let him/her know why.