It was a drama, not exactly a true story but about real people and real events in the war between the US and Mexico. The hat is a common garrison/barracks cap of the period, I have similar one. I've never heard what Prince Albert thought about it, I didn't even realize he was in it until I was watching one time and did a double-take. I checked the credits at the end just to make sure I had not been seeing things. I thought it interesting that his character in the film had the surname of "Kelly" and wondered if that wasn't an homage to his mother's Irish heritage.
The movie, btw, is about the predominately Irish US soldiers who were abused for their Catholic faith and deserted the army to fight in defense of Mexico when the US invaded. The San Patricio (St Patrick) Battalion is still revered in Mexico to this day and they have a ceremony every year on St Pat's at their monument in Mexico City.
If Prince Albert has any actual military rank I would assume it would be as the nominal commander of the Prince's Carbineers (or whatever their exact proper name is) basically Monaco's palace guard. Rainier III served with the French in World War II and earned the Croix de Guerre, Bronze Star Medal and the Legion of Honor. Prince Louis II served in the Foreign Legion and became a general in the French army in World War I and before him Prince Albert I served in the Spanish and French navies so military service definitely runs in the family. So far though Albert II's only military record is the above service in the cinematic Mexican army lol.