This is difficult to answer without more information.
8-speed freewheels were made, although not for very long. They'll be hard to find and will be "new old stock" if you do. 7-speed freewheels are still being made, mostly for low-end bikes.
However, if your bike has 8-speed indexed shifting, it's not going to work right: The gears on a 7-speed freewheel are spaced 5 mm center-to-center, on a Shimano 8-speed cassette, they're spaced 4.8 mm. You might be able to fake it if you get the derailleur perfectly aligned on the middle gear, but you'll be 0.6 mm off at the outside gears. Which doesn't sound like much, but the sprockets are only 1.8 mm thick. As always, the late, great Sheldon Brown has the info. If you want the shifting to be bang-on, you're going to need different shifters (or you'll need to switch to friction shifting). If you really want to go nuts, you might be able to disassemble the freewheel and reassemble it with narrower spacers to get the same center-to-center spacing.
Another dimension you might want to check is the hub width. Is it 135 mm? 130 mm? What about the spacing on the frame it's going into?