Could this explain why there some times is staccato markings and pedal indication at the same time?
Maybe, depending on your edition, but you might do some research on that. Where are you talking about?
Well, in prelude #2 I find it quite tricky to play LH legato in some bars, so I use pedal (sostenuto, but could use damper) to prolong the quavers. To avoid mudiness, I pedal only during quavers. I could of course move my hand as fast as possible when skipping, but since at some places I can play truly legato I feel that there will be a noticeable difference. Since this piece is simple and short, I believe one has to cherish the details to achieve some musical height. How would you pedal in this piece?
You don't need to try and rush with your hand. There are actually 3 voices in the left hand, and only the middle one need be legato. Take the first measure and look for these notes - B-A#-B-G-B-A#-B-G. Those are the notes that should be played with legato technique. The top G and bottom E are mostly filler, so let your hand become a fulcrum on the middle voice and pivot as necessary to play the other notes. That middle voice is something that occurs throughout the piece, so always bring that out.
I would use the damper, not the sostenuto pedal, and probably depress it half way on every quaver. Obviously, this is not a constant thing, as I'd probably pedal longer in some spots, like the first beat of measure 6, for example.
In prelude #4 the problem with playing legato comes with the fact that chords should be played repeatedly.
I have always thought that the legato effect was one of the core uses for the damper pedal! 
Actually, because of the double escapement mechanism of the piano, it is possible to repeat any note without fully releasing it (and in the process also release the dampers). Do a search on "double escapement" on google for more info. Using a lot of pedal on #4 is dangerous. You must be subtle with its use. Try using a half pedal (just barely depress it enough to bring the dampers a LITTLE bit off the strings) and pedal every time the LH changes harmony. I can't tell you how many times I've heard students ruin this piece just by overusing the pedal.
While it's true that you can to some degree make it sound like you're playing legato by using the pedal, you shouldn't depend on it to make things legato. Sometimes, in certain passages of music there is no possible way of making things legato, so we must use the pedal to compensate. The most useful aspect of the damper pedal is the fact that in pedaling, all the other strings vibrate, giving you an enriched sound. It's especially useful in composers of the 19th century and later, because you want to achieve a singing tone when playing their pieces, and using the overtones in the piano will make the tone sing a lot more.
I was just pointing out that legato is a technique of the hand, not the pedal. Using the pedal to produce legato might get you out of a rare bind, but your technique will suffer if you make a habit of it. Frequently, I'll play legato passages completely sans pedal as a self-check just to make sure I'm actually playing legato.
Hope this helps!