I understand how 'lock_time' field work in transaction data structure, but I also see some people talking about 'nLockTime' with similar function. So are they the same?
Yes, they are the same.
nLockTime is the name used in the Bitcoin Core source code (e.g. here) , whereas
lock_time might be more common in JSON input/output or other pieces of software. The Bitcoin Core RPC uses
locktime for example, and blockchain.info uses
lock_time in its