All civilian laws are in effect for military personnel. The military code of conduct adds to that. You are expect to behave with honor and dignity AND obey the law.
It really depends what it is. If a small item, you can keep it in most cases. Now, finding millions of dollars worth of cash, you won't be keeping that.
It would depend on the value of the item, it's historical significance (if any) and it's rightful owner. The U. S. military does not loot for spoils of war and it is forbiden.
All branches of the military have a Code of Honor. Found items would be reported and/or turned in based on the policies of the base or the circumstances as well as the Code of Honor.