Watching a Ann Frank documentary and it was mentioned that if her father had informed the state that he had served,his family would have been protected. Is this true ?
No.
Jews in Germany had dealt with antisemitism for a long time, and to many, World War 1 was an even welcome opportunity to prove once and for all that they were in fact German patriots, and many young Jewish men took the opportunity to prove their value - at least 12,000 were killed in action.
However, Germany lost World War 1, which was quickly by the political far right turned into the narrative of the Dolchstoßlegende, in which the undefeated army was stabbed in the back by treachorous forces - the democrats, the republicans, and most importantly the Jews.
And so, after World War 1, the RJF was fomed, the Reichsbund jüdischer Frontsoldaten, the Reich Federation of Jewish Front Soldiers. The organization was vehemently anti-Zionist and rejected Jewish nationalism in favor of a union for non-Jews and Jews alike under the German flag.
When the Nazis came to power, Jewish veterans initially had a patron saint in Paul von Hindenburg, Germany's aging President and former Field Marshal in the imperial army. But with Hindenburg's passing in 1934, Jewish veterans lost their privileges. With the beginning of the Holocaust's second phase in 1935, particularly through the Nuremberg Laws, they had been firmly positioned as just as dismissable as other non-veteran Jewish individuals. Most veteran protections in the Nazi German lawcode at the time were written around citizenship to only affect veterans with German citizenship. And, very conveniently, with the Nuremberg laws, Jews were downgraded from citizens ("Reichsbürger") to nationals ("Staatsangehörige"). So they would not have qualified for any benefits or protections on that basis alone.
And in the special case of Anne Frank's father, he and his family lived in the Netherlands, which was a militarily occupied territory during the war. Protection from Gestapo and Wehrmacht atrocities was simply not legally enforcable under the occupation anyhow.