Yeah your legs have longer reach and he's not trained to defend leg kicks either.
Either way it's a lot more in your repertoire to train in UFC, yeah they'd probably lose to a boxer in all round boxing but in a general fight(if you adjust for weight classes before you put Anthony Joshua vs a manaverage like McGregor) then more often than not the guy trained in multiple arts would win.