Trading was introduced in the 8/16/18 update. It allows you to trade any of your pets with others, or give them away for free. You must have at least 2 pets to be allowed to trade, due to being able to trade away your only pet for free.
Select the Trading button on the side menu. There, a list of players with trading enabled will show. You can request to trade pets with members.
Cross-trading and selling pets is against Roblox and BigGames Terms of Service and it is a bannable offence, if you see someone doing these actions report them on Roblox or BigGames discord.