I played softcore and was invited into a public game to do Baal speed runs, but worried that someone might try to kill me and loot my items. Is it possible?
No, when you die you'll drop a corpse, and you're the only one who can grab it. You can either get back to the location where you died, or you can quit and join a new game, which will cause the corpse to move to your spawn point in town.
No one else will be able to get your items from your corpse.
In earlier (like super early) patches of the game there was a mechanism where you could drop items upon death, but that was fixed.
They can only kill you permanently if you play on 'hardcore'. In this game mode every death (no matter who or what killed you) will delete your char and all your items. In this mode you can allow players to get your inventory (if you are playing with friends for example).
Most players play softcore (the default setting) and there it is impossible to lose anything from your inventory.
To kill you a player must declare you the enemy. You will see a big red skull icon on your screen. After he declared you his enemy, he is not allowed to enter any teleport portals or way points. So let's say that you are in baals chamber and a player declares you his enemy. He then needs to start from the town and move through the whole act 5 to get to baals chamber. This gives you enough time to react and go back to safety in town or leave the game. You can even go to a random location via WP and your enemy wouldn't know where you are, since this information is exclusively shared in parties.