Closest Rule
If none of the practice or qualifying sessions are held at all throughout the weekend, then the closest answer I found came from a couple of articles/posts mentioning an old version of the FIA's regulations (around 2016-2017, however I cannot find the exact regulations that cite this rule) [1] [2]. The rule states that the grid order would be set based on the driver's numbers. This would put Max Verstappen on pole position if this happened in 2022 as he carries the #1. This rule made sense in the past as driver numbers were based on the constructor's finishing position in the previous season (drivers for P1 constructor got numbers 1 and 2, P2 got numbers 3 and 4, etc.).
Discussion
However, as @ImClarky mentioned in his comment, qualifying would be delayed until the latest time possible to allow the grid to be set, even if it's the same morning of the race before the race.
If none of the planned sessions (FP1/2/3 or Qualifications) can be held at all throughout the weekend (e.g., due to weather, an incident, external factors), then it is unlikely the race would go through. Realistically at least 1 of the planned sessions can be held, and in that case the times from those sessions would be used to set the grid, even if it's FP1.
Sources