Potato and onion used in cheese & onion pasties
The raw potato will definitely cook through.  If you cooked the potatoes first, they would be almost devoid of texture by the time they cooked a second time in the oven - you'd have something more akin to mashed-potato pastries on your hands.

You might want to think about sweating the onions first, though.  Sweating them would drive-off some of their moisture and would mellow the taste of your pastry filling.  Definitely not a requirement, but I think you'd prevent soggy pastry bottoms and serve-up a better tasting treat.

Also, your recipe throws-out the notion of brushing the pastry tops with milk or egg like they are interchangeable.  Milk is traditionally used to soften the the crusts of breads - an egg wash will give your pastries a rich brown top.  I have never seen a puff pastry recipe that called for a milk wash.  Stick with the egg wash - beat a large egg with 1 Tbsp. water and brush the tops of your pastries lightly before parking them in the oven.