You are correct. Ivermectin is a specific molecule. Its chemical formula is C95H146O28. It is this same formula whether used by humans or animals. The body cannot the difference between ivermectin in a pill or a paste. The only difference is the vehicle and the wrapper.
Is the concentration of the paste the same as the concentration of the pill?