Like most graphical glitches, this is a GPU hardware acceleration problem. Your Mendocino iGPU is too new. It was released September 2022 but you are trying to install an OS released April 2022. Luckily the CPU/software part of things usually works so we can use that and get the Firefox preferences screen to show up:
Close all Firefox windows
Open terminal, and run the following. The errors don't matter.
LIBGL_ALWAYS_SOFTWARE=1 firefox
Go to ☰ > Settings > General > Performance
Uncheck "Use recommended performance settings" then "Use hardware acceleration when available"
Close Firefox
Open Firefox normally
LIBGL_ALWAYS_SOFTWARE=1 only applies until you close Firefox. Firefox should work with hardware acceleration disabled, but if it still doesn't, you could put export LIBGL_ALWAYS_SOFTWARE=1 in ~/.profile and relog, at a high risk of system lag. The GL stands for OpenGL, which is what most traditional programs use for GPU acceleration.
Once you install Ubuntu, you should run the usual sudo apt update && sudo apt upgrade . Even though the disabled hardware acceleration looks crisp, you may get some lag when scrolling. To get rid of the lag and use the GPU again, install the newer drivers by adding https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa and rerunning the usual upgrades. That PPA has the latest mesa GPU drivers for AMD/Intel, so it would support your 2022 September computer just like Ubuntu 23.10 would. Then you can reenable hardware acceleration in Firefox, and see if the graphics work after reopening.