I think it’s useful to distinguish between military service and war hero/general officer. The latter is the sort of factor that itself brings a person to public attention (e.g - Wellington, Washington, Grant, Eisenhower), while military service may “look good on the résumé”, particularly for a young candidate, but doesn’t by itself get the candidate the nomination or the election.
I do think the US skews to valuing military service more than other western democracies. The wiki list linked to by gonzomax shows that all but 10 of the US presidents had some sort of military service. Of those who served, 12 reached the rank of general officer, and three (Washington, Grant and Eisenhower) reached the highest possible rank, General of the Army. Plus, the US President is ex officio the Commander-in-Chief, which automatically tends to make military service one of the qualifications for election to that office.
For the UK, in addition to Wellington, I would be inclined to add Churchill to the list - his exploits in South Africa, getting captured by the Boers and then escaping from them, certainly brought him to public attention (he was there as a war correspondent, but according to wiki he was considered for the VC for his exploits there). Offhand, I can’t think of another British PM who was noted for his military exploits.
For France, we’d have to add De Gaulle to Pétain, but are there any others? My fuzzy recollection is that after the two Napoleans, the French from the Third Republic onwards were suspicious of “the man on the horse” - the mythical charismatic war-leader, because of the fear of a military coup d’état.
In Canada, I think that Prime Minister Macdonald may have served with a local militia. The only two other PMs with military service that leap to mind are Diefenbaker and Pearson, who were both WWI vets. No veteran of WWII served as PM - the natural timeslot for a WWII vet to serve would have been the sixties and seventies, but that was when Diefenbaker, Pearson and Trudeau (born 1919) were in office.
Trudeau definitely didn’t serve, being more of an anti-militarist, which played well in the late sixties. He dominated federal politics until the early eighties, when younger men like Turner (born 1929) and Mulroney (1939) came to power.
Plus, in Canada, the Commander-in-Chief is Her Majesty, not the PM. In summary, I would say that personal military experience is not considered part of the qualifications for the Prime Minister, as is shown by the fact that the last vet to serve as PM was Pearson, a veteran of WWI.