I would like to know if every YouTube video is playable on iPad2.
No, not every single video but most YouTube videos are playable on iOS devices. It is not easy to determine which videos are playable other than just trying to play them. There are a few reasons why YouTube videos may not be playable: old videos may have not been converted to H.264 (remember before the iPhone, YouTube was all Flash) or the owner of the video may not want it to be viewed on mobile devices or embedded in websites.
Further does iPad2 play .avi or .mp3 or .flv videos ?
Kind of. It will handle mp3 and PCM stereo audio in .avi, but not flv.
For example can an iPad2 play these videos -
I can confirm the YouTube video you linked to works fine. The other link has a bunch of different formats but most of them are not playable. The flash links will not work. Usually mov links will work but these don't look like they are H.264 and do not work. Usually 3gp works as well but I could only open it in OPlayer.
If iPad can't play these then is there an app which makes it possible?
OPlayer doesn't work for every codec, but it does bridge the gap sometimes. And it has a free lite version so it is worth the download.
I think you should take a look at the official audio and video formats supported by the iPad 2:
Video mirroring and video out support:
Up to 1080p with Apple Digital AV
Adapter or Apple VGA Adapter (cables
sold separately) Video out support at
576p and 480p with Apple Component AV
Cable; 576i and 480i with Apple
Composite AV Cable Video formats
supported: H.264 video up to 720p, 30
frames per second, Main Profile level
3.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and
.mov file formats; MPEG-4 video, up to
2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC
audio up to 160 Kbps per channel,
48kHz, stereo audio in .m4v, .mp4, and
.mov file formats; Motion JPEG
(M-JPEG) up to 35 Mbps, 1280 by 720
pixels, 30 frames per second, audio in
ulaw, PCM stereo audio in .avi file