The validity of a promo code depends on what the online casinos have programmed it to do. You can find out which games the code works for in the terms and conditions for new player deals, just look for game contribution percentage or allowed/included games.
For existing player promo codes, it's more likely that the deal will be game-specific. For example, a free spins promo code looks like 25SPINS and is linked directly to a particular game. As with all bonuses, everything you need to know about how you can use a bonus code is detailed in the terms and conditions.