There are only two things you can directly do with the money in an Amazon gift card: you can keep the gift card, or you can put the money into your Amazon account. There aren't any other options. You can't deposit the value into a bank account or anything like that. So, as far as safety, those are the only options you need to consider, because there's nothing else you can do.
(Okay, there is one other thing you can do: you could sell the card to someone else, or barter it for something you want. But you can do that with anything.)
The "gift card" is basicaly just a string of numbers and letters that you put into your Amazon account and it credits you with the appropriate amount of money. So yes, it can be stolen. If you haven't redeemed it yet, someone could find the code by hacking your email or looking over your shoulder or whatever. If they redeem it, you won't be able to do so.
As for your edit:
If I don't transfer the balance of the Amazon egift card to my Amazon account, can I transfer the balance to other accounts or use the card to buy other gift cards?
If you don't transfer it to your account, you can transfer the balance to another account by giving the code to someone else and letting them deposit it in their account. You still won't be able to buy other gift cards with it, because you can't buy anything with it until it's deposited in an Amazon account, and once it's deposited in an Amazon account, you can't buy gift cards with it because of their policy.
If you don't want the restrictions imposed by Amazon, don't buy Amazon gift cards; instead, just use your actual money to buy things. If you're worried about the cards being stolen, just deposit them into your account right away and you eliminate the risk of them being stolen. If, as you say, you bought the cards for yourself, there's no reason not to do this; presumably you bought them so you could buy things on Amazon, and you'll have to deposit them into your account eventually anyway to do that, so just put them in right away.
I don't know specifically how Walmart cards work, but I assume they're the same. In general, anything called a "gift card" offered by a particular retailer works the same way: you can't do anything with it except buy products at that retailer.
The only thing that really makes Amazon different is that the only way to use your card is to add the money to your Amazon account, because the only way to pay for things on Amazon is with an Amazon account. There's no way to spend just some of the value; you have to deposit it all into your account. With gift cards for retailers with physical locations, you can usually use the value up piecemeal, by actually going to a store and spending just enough to buy something. (I assume Walmart works this way, although I don't know if you can use an e-gift card this way there.)