You can lock certain pet groups so that users cannot offer on the pets in that group in a trade. These groups will not even show up when you are trading with someone (however you can see all their groups if you look at their pet collection). Some users will lock any group that isn't a trade group, others will leave most or all of their groups open even if they don't want to trade from certain groups. Its always good to check their trade rules and try to abide by those. Some people will leave groups open that are not labled as trades, but they are willing to trade from, so sometimes that can be clarified by their trade rules.
If you want to lock any of your own groups. First go to the group you want locked, and at the very bottom under the pets, on the left you'll see this;
Click 'Change trading settings'. There are a few different options, including only allowing trade from friends, or only allowing trades if at least one wishlist pets is offered, as well as not allowing trades at all. You can change the group trade settings anytime, however you do have to do each group individually.