Your gateway to endless inspiration
While Loki bullying his brother and dissing his mom were obviously horrible things to do, I don't think that Loki actually felt any real prejudice towards Hajrudin or his mother. I think that he was just saying the thing that he knew would hurt his brother the most and this was part of an already established pattern of Loki lashing out due to already being treated poorly by the rest of Elbaf by this point.
Remember, every giant was dunking on Harald's first wife for being non-Elbafian so it's more likely that Loki, who is much younger than Hajrudin who himself looks about seven or eight here, parroted what the older giants were saying without understanding the actual weight of it. Kids say stupid shit they overhear from adults who should know better all the time.
Plus, notice how none of the older giants in this flashback are jumping to Hajrudin's defense or holding back Loki from attacking him? If anything, it looks like they're egging on the violence. Even Harald, the peace-loving king who just said he wants his sons to get along, isn't putting a stop to one of them beating the other bloody while spewing xenophobic remarks.
You could give Harald the benefit of the doubt by saying this happened when he wasn't around (I took the 'get along when i'm gone' as 'get along after i die' but he could have just been leaving on a day trip here), but still the giants are doing nothing to defend the king's eldest son from physical and verbal abuse even from one of their pariahs implicitly because, in their eyes, Loki isn't saying anything that they don't agree with.
Frankly, it's a miracle that Hajrudin didn't become as resentful of Elbaf as Loki did.
You know, Hajrudin kinda has a point