You can buy something with a Walmart Gift Card but you won't get cash money back from returning the item you purchased.
Walmart will allow you to return the items as long as you have a receipt for the items but they will give you money back on a gift card for store purchases.
So you can use the funds on the new gift card they issue you to purchase something else if you return the item you bought with the gift card but they won't give you cash.