This is very possible. Most graphics APIs support a concept known as alpha blending, a process of combining two images in such a way as to make it look like one of them is transparent.
This is generally accomplished by adding an additional color channel to the standard red, green and blue channels: alpha, which represents how opaque a pixel is. Zero indicates a fully transparent pixel, and the maximum value (usually 1 or 255 depending on how the color channels are represented indicates full opacity).
Thus, to accomplish your goal of a game with a background other than solid black, you need:
To author your sprites such that the "background" parts of the sprite is transparent (has an alpha of zero) and the foreground parts aren't (full alpha, or partial alpha to give a "see-through" effect to part of a sprite). Most image editors support this, consult your editor's documentation.
To save your sprites such that the alpha is preserved (i.e., in a format that supports it).
.png is widely-supported and has alpha-channel support.
To load your sprites into RGBA textures. Often this will be handled implicitly by your graphics API, if you are using utility functions of the form "load texture from file." If you do have to manually specify a format, make sure you specify one that has four components ("RGBA" for example).
To enable alpha-blending support in your graphics API. This is the part where you will have a lot of variability depending on what you are doing. You can consult your API's documentation on alpha-blending to learn how to enable it, it's usually only a few calls to enable the function and describe the blend factors. For example, in OpenGL you need to make calls to
To make sure your shaders, if you are using them, correctly output alpha values from the fragment shader. Since the alpha is stored in your texture (if you did the previous steps above), this means you just need to make sure you sample the full color from the texture, and aren't doing any masking to just the
rgb components or anything.
You may also run into a technique called color key transparency. This is a similar technique, often used when for whatever reason alpha channels aren't available or are undesired. It's less common these days, it was used more often before hardware accelerated rendering was so common and we would blit our sprites by hand. It works, essentially, by selecting a color meant to be transparent (usually something like a hot pink or full blue, something unlikely to be used for "real" pixels) and simply not copying those pixels when blitting an image. These days it is often easier to simply use the alpha-based methods, or at least translate color-keyed sprites into ones with alpha by the time you get to rendering via the graphics card.