In U.S., a debit card or an "open loop" gift card will normally have a Visa or MasterCard logo on it, and the card can be used in "credit" mode.
Does that mean that such a debit card or gift card can usually be used anywhere that a credit card can?
Definitely not with gift cards and to a lesser degree not even with debit cards. For most transactions they work the same but you'll run into problems when dealing with situations where a hold is placed that's higher than the transaction amount.
This is the norm with gas purchases--at the time you run the card you don't know how much gas you're going to pump so they put through an authorization for some fixed amount--say $75 or $100. If you do not have this much available it will fail and you can't use the card to purchase the gas. Unless you're living paycheck to paycheck the debit card should work in this case but the gift card very well might not.
I've also seen this happen on a larger scale with a car rental. A co-worker only had a debit card--and the substantial hold the rental car place wanted to put on the card was unacceptable.
In addition to what has been said, gift cards with a credit card logo (which is what I am assuming you mean here) do not have an address associated with them. That means that if you try to use one at a merchant that users address verification (common in online purchases), the transaction will fail.
In my experience with an American Express branded gift card, I was able to call the number on the back and they added an address to the card so that it would work. It seemed like this was a common and well known issue.
Because the gift card is not associated with any person, no verification is needed to add that address, you can give them any address you want.
Also I believe that the card numbers in use for gift cards are specific, that is you could tell that a card is a gift card based on the number alone. That means it is likely possible for a merchant to reject those gift cards while still accepting other cards from that network.
This is likely for certain transactions. For example, a hotel or car rental agency requires a credit card for incidentals, and it's likely that the system itself will outright reject a gift card even if it has enough on it for the initial hold.
As for debit cards, I think there are far fewer issues with acceptance, other than the aforementioned hold issues described in another answer.
If the cards are tied to a specific vendor, they will work only at that vendor. If they're generic cards just charged with a specific amount of money, they should work at any vendor who accepts that card network... though there may be specific exceptions.