Can I swap a different engine into my car?
Yes, absolutely. The limiting factors are usually cost and time, followed by availability of parts and physical size.
Swapping in an engine that was already available in a J-body is the easiest option. For example, replacing a 2.2L (pushrod) or 2200 with a 2.4L or 2.2L Ecotec. At most, you will have to change some wiring to make it work. Several variables come into play, such as the years of the motor and the car. It would be more difficult to swap a 2.2L Ecotec 5 speed into a 95 2.2L auto car, but it would be quite simple to bolt a 97 2.4L Twin Cam auto into a 97 2.2L (pushrod) auto car.
Slightly harder would be an engine similar to one of those, but one that wasn't used in the J-body. Examples would include the Quad 4 HO, the 2.4L Ecotec, or 2.0L Supercharged Ecotec. Rewiring and welding of new mounts may be required.
Much harder would be an engine that wasn't used in a car this size. Examples would include the 3400 or 3800 V6 motors. Such motors are easier to swap into 1st and 2nd gen cars due to the larger size of the engine bay. However, these motors have successfully been swapped into 3rd gen cars as well. The cost is usually quite prohibitive, between $5000 and $10000 just to get it running. Of course, this price estimate will vary based on who does the work and where the parts come from. Custom mounts and subframes will be required.
Extremely difficult would be something like a 350 small block, that would require the car to be swapped to rear wheel drive. Or the Cadillac Northstar V8, which is too wide to fit between the 3rd gen frame rails in stock form. That takes some major work and major cash flow ;)
The key with any engine swap, is making it run. In essence, you'll have to swap everything that makes it go. That may include the transmission, PCM, wiring harness, axles, ignition, fuel system, cooling, etc. It is most useful to have the entire donor car handy, to help with the swap.
So what has been swapped? Plenty!
Many people have gone from 2.2's to 2.4L's to Ecotec's. Fairly common swap, easy to do, parts are usually easy to come by.
I know of one person who swapped in an Integra (B22?) engine, but scrapped the project due to prohibitive cost. It would have ended up being a stock Integra in a Cavalier shell, but cost more than the two cars combined.
Some people have swapped V6's in, including the Supercharged 3.8 V6 (L67) from the Grand Prix GTP and the 3400 V6. You can find the owners of these vehicles in the forums easily.
There are quite a few V8 RWD swaps out there, but they are far from daily drivers - usually reserved for race applications or show use.