First is to rip a CD to my PC using on board CD drive & on board sound card the file is finally stored in let us say wav format.
In second case, the same CD if played on an external high end CD drive (M5), input it to PC & stored in wav format
I think both will be the same, assuming that the extraction was correct. I second the recommendation for usage of Exact Audio Copy software as the tool used to the rip.
I see that in your first comment, you mention the sound card. In either case (internal or external CD drive), the sound card won't have anything to do with the extraction of the audio files. The sound card will have something to do with playback. If you are using a digital output of the soundcard, most (all?) of the digital decoding work will be done by whatever DAC you are using (may be a receiver a pre/pro or a dedicated DAC). If you are using analog outputs of the soundcard, your audio quality will be much more dependent on that soundcard's audio characteristics. Many sound cards are very cheap, and will have a less than good audio quality. I would very much suggest using a digital output on the soundcard.
I'll offer some other comments here that are related...
Audio file quality depends on the file type, or more specifically, the compression type used. wav files represent the music as it was stored on the CD itself and use zero compression. In general, wav is one format that's "as good as it's gonna get." (although I suppose it could be argued that one could employ interpolation algorithms and upsampling to "improve" resolution, but that's a separate discussion; I just wanted to note it here for the next guy that comes along and says "no it's not!").
As you probably know, mp3s take a lot less space on your hard drive. These use a lossy compression scheme that reduces the amount of information in the music, and therefore the quality of the original recording. Now, there's going to be some guy that comes along to tell us that there's some double-blind test where so and so couldn't tell the difference between wav files and 320 kBps mp3s and blah-de-blah-de-whatever......... Yeah, mp3s are pretty good for what they are, but there is (without question) loss of musical information occurring when that translation happens (from wav to mp3).
There are also other lossless audio storage formats. These allow a reduction in the size of the file, while still maintaining the audio quality. You may ask: "how do you reduce the file size without losing information?" Well, imagine you had a digital photograph that was simply all black. One way to represent it (I think BMPs would to it this way) is to define a value for each and every pixel. So, your data file would be "black, black, black, black, black, ... " for the size of the file (8 megapixels, anyone? That's a LOT of "black, black, black..."). Another representation would be to have a file that noted the color value, and the number of pixels that are that color. A file like that would read "black, 8,000,000" to represent that it contained 8 million black pixels. That's much smaller than the BMP that represents each pixel with a value. Anyway, that's a rather trivial example, and there are other ways to take advantage of repeated information in audio, photo and video data.
A popular lossless file type in use today is FLAC (Free Lossless Audio Compression). I use this, and offers me roughly a 30% decrease in file size. That's great, but I find it useful for a more important and practical reason: it allows use of the mp3 style "tagging" that lets me name, organize and easily search my music. wav does not support that type of tagging, and it's really hard to quickly and easily find the music desired in media players like MediaMonkey and Winamp when using wav files (actually, wav might support
some tagging, but it's very rudimentary compared to the mp3 style tags).
Anyway, there's some of my take on this stuff. Hope that helps.