Apple changed how their Trackpads work beginning around 2015. Prior to 2015 the Trackpad was considered a basic USB device, but in 2015 the Trackpad communication was changed to communicate as SPI (I don't recall how that works...a different communication protocol). I know that the 2015 model can utilize either mode, but I don't know about later Apple USB-C models which utilize a T1 & T2 chips. Keep in mind that Apple tends to do things their own way using custom hardware with no public documentation. It is only Linux users with sufficient motivation & skills to see proper Linux drivers developed who help us to have Linux support on Apple hardware.
Try using a wired USB mouse. If the wired USB mouse works, then you don't have the necessary Trackpad driver available or working on your Linux installation....assuming the links I provided earlier say the Trackpad will work (I have not reviewed the information for a while now, plus it can vary between different models). If the USB Mouse does not work, then most likely you have an issue with the Ubuntu installer or USB stick (or some other hardware issue with the laptop).
I know that some Linux distributions will not allow any USB-C connections until the user approves the connection so this could be an issue when using a USB mouse.
I don't normally use any of the Ubuntu flavors so I am not certain about the Ubuntu system defaults including what drivers are available out of the box. I know with some Linux distributions you may need to install some drivers separately from the distribution's software repository. Like I said previously, I have successfully booted Kubuntu 2022 version on at least a 2017 model (not certain if I did so with a 2018 model). I don't think I had to do anything special. I know in the past sometimes I have had to install Linux onto an external drive using another computer....install any extra drivers before I can run Linux on a newer model.
You should definitely be trying the most recent version of Ubuntu as it would include the most recent drivers at the time the specific distribution version was released. You will probably have more luck asking for assistance on the Ubuntu forums (or whatever distribution you are trying to use).