It is not uncommon for employees not to get along with their bosses. It's a natural part of the work environment -- not everyone sees eye to eye. However, there are times when strained relationships can escalate to the point of managers threatening to fire employees. If this threat is unwarranted, you must take immediate steps. Even if it is warranted, you can still take steps to stay employed.
Talk to Your Manager
The first thing you should do is talk to the manager who is threatening to fire you. Do not speak to him right after the threat is made -- wait a day until after any anger has subsided and people tend to think more clearly. If the reason for termination is not clear, ask for the grounds under which the firing would take place. If the manager is vague, such as saying it would be for a series of repeated behaviour, ask for specifics. Talk to your manager about how the relationship can be mended. Perhaps you can be reassigned within the company to a position that makes better use of your skills.
Talk to His Supervisor
If you are not satisfied after talking to your manager, talk to his manager, if such a position exists. If you feel the manager has no viable grounds to fire you -- such as it being an overreaction to a single poor performance -- explain this to the supervisor. You can file a complaint with this manager. If the second-level manager supports your manager, there might be little else you can do. However, the second-level manager could hold a meeting with you and your boss to try to come to an amicable resolution, be it both sides parting ways or everyone continuing to work together.
Talk to Human Resources
Most terminations include a representative from the human resources department, should one exist with the company. If your manager has come to you in a threatening manner that is unwarranted, you should speak to a human resources representative and file a complaint. It usually will be investigated. Your HR department is there to resolve problems, so it is imperative to communicate any issues with one of its representatives.
The worst thing an employee can do is to overreact to your manager's threat to fire you. It could be his way of letting off steam or another way to cope with stress. The danger you can run into here is that you can get into a verbal fight with your boss and, in your anger, do something for which you can be terminated, such as swearing at your manager or exhibiting behaviour that contributes to an unsafe working environment. You need to discuss these issues rather than confront.