Can two Airlines have the same ICAO code but different IATA codes or vice versa?
IATA codes are not unique. There simply aren't enough of them and they are expensive to maintain. Additionally the concept of an airline is a little fluid.

The simplest issue to deal with are controlled duplicates, where 2 airlines that are geographically seperated share an IATA.

Another key issue is where an airline may have one commercial brand but several corporate entities each with there own IATA for cabotage purposes. LATAM group is a key example of this, but several european airlines (easyjet and ryanair) are also going down this route to be prepared for brexit.

Many small regional airlines in places like Alaska,the Australian outback and the Caribbean will simply not be able to afford an IATA code, or may make up there own 2 letter code that is not an IATA code.

Finally you have franchise operators like flexflight, who operate a single route themselves to maintain membership, and then provide ticketing services to other small airlines, using there code to interact with the GDSes. In this case, one IATA code can represent many potentially geographically overlapping airlines, but they are usually separated by something, often flight number.

If you wish to track all airlines in general, you are going to have to come up with your own id.