ICAO flight plans can accept 4-letter ICAO airport or heliport codes for departure, destination and alternate. As the pilot, all you need to do is specify the departure and destination airports with ForeFlight, regardless of domestic or ICAO format flightplan.
With an ICAO format flightplan, ForeFlight will recognize if the format of the departure, destination, or Alternate airport is not a valid 4 character ICAO airport identifier. If the airport does not use an ICAO identifier, ForeFlight follows the ICAO flight plan format rules and automatically replaces the airport with "ZZZZ". ForeFlight also automatically codes the other information in field 18 with the proper keyword DEP/ or DEST/ or ALTN/ followed by the identifier that you coded.