It does not matter if one or both of them have items. You can initiate a Trick just fine (as long as there are no unswappable items like Z-crystals involved), in which case the item swap will persist after the battle ends, but if the *wild* Pokemon is the one who tries to use the move, nothing will happen, in battle or afterward.