According to this article, it mentions that players have confirmed that you will receive both candies and stardust when feeding berries to a Pokemon while at a distance.
According to the Silph Road, players have confirmed that you can get candies and star dust by feeding your defenders berries from the game’s info screen remotely. Although the patch notes state that doing so will reduce the amount of motivation the Pokémon receives from the berry, a user named Barstool confirmed receiving star dust and a candy from an ally’s Kangaskhan:
While I have yet to receive candies from feeding berries, both close and far, the article mentions players have calculated actually obtaining berries is a very small chance.
However when players crunched the numbers, they found the chance of obtaining a candy this way was less than 1%, and that assumes all Pokémon have the same (or similar) drop rates.