By default, you don’t get any XP from the Buddy system in Pokemon Go. Here’s a great trick to get XP from the buddy system: First put a Pidgey as your Buddy. Second, walk 1km to get a candy. Do this 12 times and use the candy to evolve a Pidgey. You’ll get 500XP doing this, or 1,000XP if you’re using a Lucky Egg.
The Pidgey is one of the best Pokemon to do this with as you only have to walk 1km to get a candy and it only costs 12 candy for an evolution.