Application forms give photo sizes in millimetres, inches or pixels. Type one and see the others. Nothing is uploaded.
One inch is 25.4 mm. Pixels = inches × dpi. So 35 mm at 300 dpi is 35 ÷ 25.4 × 300 = 413 pixels. Results are rounded to whole pixels.
The presets are common sizes, not official requirements: each country, visa type and portal sets its own, so always confirm on the official site. dpi is only a label stored in the file; what a portal checks is usually the pixel size and the file size.
How many pixels is 35×45 mm? At 300 dpi it is 413×531 pixels. At 600 dpi it is 827×1063 pixels. Pixels = millimetres ÷ 25.4 × dpi.
How many pixels is a 2×2 inch photo? At 300 dpi it is 600×600 pixels (2 inches = 50.8 mm).
Which dpi should I choose? Use the dpi the application states. If it only gives pixels, dpi does not matter for the upload. If it gives millimetres and no dpi, 300 dpi is the usual choice for printing; confirm on the official site.
Informational tool, not legal or tax advice.