Getting older Windows 95 and 98 games running on Windows 7 depends on a few factors, including the game itself and whether you're using the 32-bit or 64-bit version of Windows 7.
Many games from that era contain 16-bit code, which simply can't be installed on 64-bit versions of Windows. For games that use only 32-bit code, you may be able to get them running through compatibility mode.
To try this, right-click the game, select Properties, and open the Compatibility tab. In the dropdown box, choose Windows 95 or Windows 98, then click Apply. With a bit of luck, the game will launch as it should.