I see a lot of internet pages offering to give you sim-unlocking codes to unlock your phone, by giving them your IMEI (and money)... If they can generate the code by knowing the IMEI, why cant i?
Because you didn't reverse-engineer the algorithm, nor purchase from someone who did.
It's script kiddies all the way down in the mobile industry.
Further, if it's an iPhone it's a scam: Apple has a central database of which phones are clear, locked, or stolen, and no code you enter can change this.