Hi, and welcome to Azeroth!
You seem to be a very new player, but you are asking sophisticated questions, so I’m guessing this isn’t your first rodeo MMO?
Two types of loot drop in levelling dungeons: trash loot and boss loot.
Trash Loot: You will often see junk, bits of gold, and gear drop from trash mobs. The gear that drops from trash is usually Binds when Equipped (BoE), usually Green quality or less, and can be sold or traded. This loot is influenced by nothing at all. It is entirely random. Anybody might get anything.
Boss Loot: In random groups, and indeed at max level these days, Boss Loot is Personal Loot. This will usually be Blue gear, and it drops for your Class and your chosen spec - though I am personally convinced that one’s a bit weak or glitchy; I’ve had wrong weapons drop for my spec. Boss Loot will be Bind on Pickup (BoP), aka Soulbound when you get it.
You can select which spec you want loot to drop for. Right-click your portrait and you get a menu of options. One of those is Loot Specialisation, where you can choose “Current”, in which loot will drop for whatever spec you are currently in, or any one of the three. This can be handy if, for example, you are running as DPS but hoping for a Shield for your Tank spec.
You can trade an item of Personal Loot to your party IF you already have a higher item level piece in that slot.
But what drops in Personal Loot is YOURS. It was generated FOR YOU. It dropped FOR YOU. You have no obligation of any kind to anybody about it. If you don’t want it, and you can trade it, and someone asks for it, then sure, you can trade it to them, but it is not bad form to refuse. It’s unlikely anyone will ask in levelling content anyway.
You are certainly not taking anything away from anyone by looting for another spec. The first “roll of the dice” for loot in these parties is: who gets loot from this boss. If you were chosen, your loot spec had no effect on what other members of your party got.
Equip your new shinies in good health and full confidence of ownership!