Can I run UE4 on the iMac?

Here is the recommended hardware for developing with UE4

I would recommend having a good GPU, the one in the machine you are mentioning scores around 1600 on Passmark, For the price you are spending ~2000$ you can get a Desktop machine that will destroy the IMac in computing speed and GPU power. IMO, I wouldnt get an iMAC because your main reason is to develop in UE4/