For the US Army, Infantry was by far the most dangerous branch of service. [The top ten US army divisions for casualties suffered and days in frontline service were all infantry divisions] (http://www.historyshotsinfoart.com/USArmy/backstory.cfm)
I believe this is because U.S. infantrymen were most likely to hold a frontline sector for long period of time and to therefore be subject to artillery fire for the longest period of time. In WW2, Artillery fire inflicted the most casualties along the front. Armored formations tended to be employed in more mobile attacks which made artillery less effective, and it is less effective against armor generally.
For Axis and Soviet armies, which had much longer fronts with more quiet sectors, this may or may not be true. Their armored formations tended to be concentrated in the active sectors of the eastern front and may have therefore seen more heavy fighting.
Lastly one should consider time spent in training. Any military occupation that has a long training period means a soldier has less time at the front. The longer a soldier is in a frontline role, the more likely they are to become a casualty.
It depends what you mean by become a casualty. Tank crews in WW2 tended to have a higher survival rate than infantry, and this tended to hold true across most fronts. It was certainly the case. For the British, American and German armies. I am unsure about the Soviet Army, but considering the appalling casualty rate their infantry suffered and the relatively rugged design of Soviet tanks it would probably extend to them as well.
As for injury,from my study of military medicine, tank crews had a much lower incidence rate of injury in comparison to infantry, so their job was less dangerous in that respect. However injury severity was higher among tank crews, as was mortality rates for those injured in a tank compared to those injured in an infantry regiment. A large amount of those were down to severe burns crewmen suffered when their tank caught fire. The average across the US army was 1 crewman killed and 1 crewman wounded each time a Sherman was knocked out, out of a total crew of 5.
So in summary, was safer to be in a tank than it was to be in the infantry, as the incidence rate is much lower, just when you are injured in a tank, its more likely to be fatal