The employer is allowed to say anything that is true, or that they honestly believe to be true, even if they are wrong and even if it is negative. They do not have to be correct; they only have to be acting in good faith.
If you were fired for excessive tardiness, they are allowed to say that. If you were fired for not getting your work done, they can say that. If you were fired for sexual harassment, not only are they allowed to say that, they are almost required to say that. If you were fired because in their opinion, you were not getting along with your co-workers, they can say that too.
They cannot say anything that is factually untrue, and they cannot say anything in such a way as to deliberately mislead a prospective employer.
Now that you have the bad news, while they are allowed to say that, the large majority of employers don't.