Yes, you can, but we wouldn't recommend it unless you are clearing space for a different type of animal that you need more. If you interact with the duck in question after you have already petted them, then you will be able to sell them if you wish. If you have a max relationship with your duck, you can make a profit on your original investment, as they can be sold for 1,565g. However, we once again need to reiterate, don't sell your duck unless absolutely necessary.