No - it is impossible for a phone network to know whether or not the lock on your phone is active or inactive. You are the owner of the handset and any information related to the hardware or software of the phone is part of your privacy. There is also no way of any other company knowing if the phone is locked or unlocked without actually handling the phone itself.
Part of this is the fact that there is no way of tracking if an unlock code has been used or not. The unlock code simply tells the phone to remove a lock that is programmed into its hardware. It isn’t done using any form of communication tool, such as the internet, which therefore means that it isn’t trackable.
Although it isn’t illegal to unlock a mobile phone some people may have contracts with networks where unlocking the handset before a set period of time will void some of their terms. You should also know that phone unlocking will not void your manufacturer warranty, but in case you are a worrier (and we know some people are) then you should be aware that a network or anyone else for that matter, cannot know if your phone is locked or not.