My teammate attacked my opponent and received 2 stars in Clan Wars. Will I get the full loot if I beat his attack by getting 3 stars? Do I lose anything if I'm not the first attacker on a base?
You will still get the full loot from the attack, it is not affected by previous attacks. The opponent's base will not have any damage from the previous attack either, so it doesn't work as a tactic to attack bases stronger than you can take down yourself.
The only thing that is wasted is the total star potential for the war. If a target base already has two stars achieved from previous attacks, at best you can only gain 1 additional star that your clan did not already have. If you attack a base that has not been attacked yet, you can still achieve up to three stars that your clan did not already earn. So you need to balance the need for your clan to get more stars to win against your own desire for loot.