In most trials both are used, DKs usually makes for the better main tank while Necro makes the better off tank. DKs main buff/debuff works better as main, up keep of Stagger is more useful on Main boss, while Necros fits better with off tank, such as their Empowering Grasp needing to be aimed at group. More to it than that but its one of the bigger points.
Would probably say Necromancer is better for Dungeons.
in your opinion why would one of them be better at tanking than the other in dungeons and trial(main tank)
Both characters make REALLY good tanks if they are being played by experienced players. I think the difference between the two is that DK is basically easy mode because everything they need to be a good tank (chain, crowd control/root abilities) and the passives play well into sustain and survivability.
The necro has great self-heals and has access to a lot of damage reduction, which are all qualities that make for a good tank as well (and IMO, a good Off-tank). But it lacks the class chain, so you have to go outside of the class kit to get that ability (Fighters guild). But the necro makes up for that with awesome group support ultimates.
Overall, I think the necro gets the edge in group play where you have a dedicated healer running Warhorn just for the group buffs, but because its passives are geared towards damage reduction and not sustain, it has a higher skill level to play at a high level IMO. I think the DK is basically tanking easy mode, but perhaps offers just slightly less to a group in terms of group buff utility (but not that much).