I've heard this story a few times, and it seems to originate from this story. But has an appendectomy ever been a requirement for submariners of a specific nation? Or is it just a legend and an encouragement for young people ("Your belly hurts, but well, you'll be able to work in a submarine once the doctors are done!") ?
According to the US Naval Institute, yes an appendectomy was performed on a submarine.
On 11 September 1942, Pharmacist’s Mate First Class (PhM1/c) Wheeler B. Lipes agonized over the most difficult decision of his life. He had just diagnosed his shipmate, Seaman First Class Darrel D. Rector, with acute appendicitis. With their submarine Seadragon (SS-194) external link cruising in enemy waters, there was no way to get Rector to port in time. World War II submarines always carried a well trained corpsman, but their small, 55-man complement did not rate a doctor. Lipes could attempt an appendectomy, but the operation might kill his shipmate.
According to that site (and pretty much every google search result) the surgery was successful, and Lipes even received a special commendation for his actions.
According to NPR, a reporter even won a Pulitzer Prize for reporting on that story.
I see no reason to doubt this story.
As to requiring a person to have had one prior to serving on a submarine, there is no documentation saying so. As one Navy site says (emphasis mine):
As it turned out, most Appendicitis problems will cure themselves with proper care, so the Navy quickly indocrinated the upcoming Submarine Officers and Pharmacist’s Mates to NEVER DO SURGERY UNDER ANY CIRCUMSTANCES. The other two Pharmacist Mates that performed the surgeries, like Moore, had assisted on many other surgeries prior to entering the Submarine Force, and the Navy worried that incoming Docs, who may not be as thoroughly trained may be lulled into a false sense of ease of surgery.