If you’ve ever played a first-person shooter and wondered whether or not it’s realistic that you go around picking up weapons and ammo from fallen enemies, this AskHistorians reddit thread has many examples of it happening in conflicts throughout the 20th century:
Looting dead enemy soldiers for weapons wasn’t just allowed, it was one of the few things you could loot from an enemy soldier according to the rules of engagement. After all, you wouldn’t want to leave it behind for the enemy to pick up and put them back in their supply chain. If soldiers encountered enemy weapons, they either took them or destroyed them. This is why your grandpa has a Luger and a Nazi bayonet.
I’ve heard stories of soldiers in Vietnam getting rid of their M16’s in favor of enemy AK-47’s because the AK was a much more durable gun. Now, as for the wisdom of doing this, it would probably depend on the situation. In a desperate battle like Stalingrad, anything you can get your hands on is fair game. However, different guns make different sounds and shooting an enemy AK in the jungle might draw friendly fire towards your position.