SQL to add zeros in front of existing data to meet field length
SELECT LPAD(nationalitycode, 5, '0')
FROM...

See https://firebirdsql.org/refdocs/langrefupd21-intfunc-lpad.html
If you want to update nationalitycode:
UPDATE ...
    SET nationalitycode = LPAD(nationalitycode, 5, '0')
WHERE ...