Imagine smart contract getting triggered by transaction and as result it sends another transaction. How is the code shall be executed? If each node will execute code there gonna be lots of same transactions with only possible difference in timestamp. So, how does this issue can be avoided?
This is not quite the correct way to view transactions on the blockchain.
All of the nodes are competing to be the first to commit the block of transactions to the existing chain. Then ALL the other nodes receive that block and store it with the rest of their chain data.
Therefore, even if there are temporal differences between independent nodes, they are all still only storing the same transaction. And the record of transactions is made up of the sum total of all the chain data.
Also, transactions are not committed immediately when you submit them. They are placed into a list of pending transactions, along with their accompanying gas (transaction fee). Those transactions that sent along a higher accompanying fee will be selected for inclusion into the block being currently mined.
See this article for some explanations