iMac freezing on boot Apple logo
Looks like graphics driver is switching to basic configuration. If you’re not using any external monitor or recently used safe mode which couldn’t revert back to normal boot.

Another guess is an unsupported kext which is installed by a faulty or unsupported app or a corrupted kext cache.

You can take following actions as troubleshooting tips. These are however not guaranteed to work for your situation. 

1A) You can rebuld the kext cache. 

// Open Terminal (/Applications/Utility/Terminal.app)

sudo kextcache -i /
paste the above line and press Enter (It will ask you for system password).


1B) Optionally you can download kext utility to rebuild the cache for you. (Not tested on Mojave)

Download Kext Utility

2A) You can repair permissions from Disk Utility. /Applications/Utilities/Disk Utility.app

2B) Run First Aid. (It will repair disk permissions and also find common disk errors.

If it doesn’t solve the problem, try resetting the SMC and NVRAM. It will revert your computer to default configurations.