The maximum Triac gate-current is the maximum you can apply, not what it will take. Since the gate looks like a forward biased diode, the theoretical peak gate current will be about ((24V *1.4)-0.7) / 38Ω = .87A at the peak in the input sinewave (this may be reduced some by the optocoupler output impedance).
But that current will only occur for a short period of time until the Triac turns on (perhaps several tens of microseconds), at which point the voltage drops to the forward conduction voltage of the Triac of perhaps a couple volts. So the average power dissipation in the 38Ω resistor will quite small and the lowest power available resistor should work fine.