I understand your goal in asking this question, but I think you're approaching it wrong: you should choose a kayak based on your skill and expected use. Each type of kayak will have benefits and drawbacks in each type of water, and some are completely unsuited for it -- choose one that fits your uses best. A well-known example: a recreational kayak is the wrong choice for kayaking on the ocean.
Class 1 and 2 rapids are fantastic. I think it's probably fair to say that anybody with no skill and the right boat can make it through class 1 rapids with no concern. I think class 2 rapids should probably be handled by somebody with at least a little experience on the water, and the less experienced should always be accompanied by somebody more experienced.
So, I am confident that you could do some class 1 rapids with any of those types of kayaks. For class two rapids, I would first be concerned with your skill level -- both on the water in general, and with the type of kayak being used (and maybe even the specific model). While class two rapids may not require much maneuvering, spinning a 20' sea/touring kayak is going to be practically impossible and therefore impractical; a 14-16' sea kayak is probably manageable for any experienced paddler. A whitewater or completely flat-bottomed rec kayak provide the maneuverability required, however a less experienced paddler will find themselves spinning with each stroke and out of control -- and therefore perhaps in a dangerous situation.
In my opinion, the right choice for a new paddler is a rec kayak. They're fun, easy to use, and relatively cheap to buy/rent. Getting some experience with an eye towards determining what you ultimately want to do will help you make an informed decision. Rent a few times and take a lesson or two and you'll have gained a huge amount of experience to help you know what kind of kayak you really want and will lead you to the best choice.
Experience is king. An experienced paddler will be able to take anything through class 1 or 2 rapids, no doubt. An inexperienced paddler could end up in a dangerous situation. I think it's essential to start out on calm flat water to learn strokes, practice technique, and gain some confidence. On that flat water you can learn to maneuver the kayak around strainers, rocks, or buoys. You can learn how a sweep differs from a front stroke, and what you can make the kayak do with each of those. Also on flat water, try working in windy conditions -- it'll do a surprisingly good job of mimicking how a river and rapids can push your boat around and teach you how to handle it. Once confident, go out on a slow river to put your skills to the test. Eventually move up to some faster moving water, and throw in a class 1 rapid. Try a short class 2 next. Then if you can find it, go through a long class 2 -- you'll get splashed quite a bit and get a solid workout. After working through class 2 you might want to step up to class 3.
While gaining all of this experience you're going to learn how a kayak handles and what it does well and poorly, and more importantly you're going to see how your skill grows with it. As you do this stuff you'll be able to recognize where each type of boat is the right choice.
Trying to more directly answer your question: IMO, a whitewater kayak is only useful for whitewater/surfing waves. A sit on top is good for jumping in and out of the water. A rec kayak is a good choice for many. A short touring/sea kayak is a good choice for many. A long touring/sea kayak is the right choice for racers and travelers.