Yes it is just a random letters and numbers for a gift card code.
Can they know my Amazon account if I take it ?
Nope they can't see who redeems it. Nor does Amazon honor any requests to refund/reverse "accidentally" sent gift card codes.
I don't think this one is very scammable, but note that the same cannot be said about money, while we're on that subject:
I received a money transfer from a stranger. Where’s the scam? | Kaspersky official blog
Namely, with cash/bank transfers, it's a common scam for a stranger to send you money and then say it's a mistake and ask you to send it back. Then, they cancel that transaction with the bank. You'll see the original balance reversed by the bank but legally speaking, because you sent them the money back, you authorized that transaction and cannot get your money back.
If someone accidentally sends you money via Paypal, Venmo, Apple Pay, etc etc, don't send it back to them, that's for them and their bank to deal with.