If Dhelmise does "Giga Drain" and the Defending Pokemon only has 10 HP left, does Dhelmise still heal itself for 30 damage?
Yes, because the 30 damage is still done, even though it is more than enough to KO the Defending Pokemon.
Giga Drain






x2

Giga DrainHeal from this Pokémon the same amount of damage you did to your opponent's Active Pokémon.



EarthquakeThis attack does 20 damage to each of your Benched Pokémon. (Don't apply Weakness and Resistance for Benched Pokémon.)
If Dhelmise does "Giga Drain" and the Defending Pokemon only has 10 HP left, does Dhelmise still heal itself for 30 damage?
Yes, because the 30 damage is still done, even though it is more than enough to KO the Defending Pokemon.
If I have a Tera Pokemon on my Bench when I use Landorus' "Earthquake" attack, do they take 10 damage or not?
No, the Tera Trait protects them from damage by your own attacks as well.