Hi, this depends on the jurisdiction you are using this word.
One of the main differences is a company is a legal entity (e.g. has limited liability) but a firm can be a description for a different number of legal entities.
For example, a partnership can be a firm, but it cannot be a company.