The samurai defeated Mongol invasions twice. The early proto-samurai fought in the wars of the Three Kingdoms Period of Korea and carved out a territory for Japan that lasted some generations. In the late 16th Century, samurai cut a bloody destructive path through Korea but their Achilles's Heel was the sea.
By the time of the Russo-Japanese War and Sino-Japanese War which were victories for Japan, the samurai no longer existed as a class.
The reason why Japanese are proud of the samurai is not their deeds in battle but their ideals of loyalty, discipline, and dedication to duty. Many salarymen see themselves as a modern samurai in this respect.
Not all historical samurai were like this of course but it's the symbol of the samurai rather than the actual historical reality that people are proud of much like Europeans are with knights and Americans are with cowboys.
One of the most popular stories of samurai that best illustrates the traits that Japanese admire in the samurai and themselves for that matter is the story of the 47 Ronin:
http://samuraidave.wordpress.com/2007/12/22/japan-remembers-its-47-hero-samurai-the-47-ronin-story/
One scholar said that to know the story of the 47 Ronin is to know Japan.
Also in modern times, samurai are still seen as cool as represented here in Akihabara:
http://www.youtube.com/watch?v=fRJJFsN5IME