can I splice underground 12-2 UF cable run to a water pump
You can splice the NM above ground in a box above ground then run the UF to your pump. The depth for UF cable to be buried as you exit the foundation is 24” per NEC table 300.5.