Yes but assassination is assassination, whether done by someone with political grievance or a looney bin. But Garfield was killed prior to 20th century, so he does not count while McKinley does.
List of assassinations in Europe
List of assassinations in Asia
List of assassinations
Counting only people who were actually in office at the time of their deaths, and countries with three or more assassinations, I count …
Burundi: three prime ministers and one president.
Egypt: three prime ministers and one president.
Nigeria: one prime minister and two heads of state
Afghanistan: one emir (when the country was an emirate), one king (when it was a kingdom), two presidents (one a Soviet puppet), one prime minister (Soviet puppet)
Bangladesh: two presidents, one prime minister
Iran: three prime ministers and one president
Iraq: one king, two prime ministers
Japan: four prime ministers
Jordan: one king, two prime ministers (one of whom was killed in Egypt)
Lebanon: one head of state, one prime minister, one president
Yemen: one king of Yemen and two presidents of North Yemen (when the country was divided)
Portugal: A King (also a crown prince who survived his father by a few minutes but who was never crowned), one president, and one prime minister.
Spain: three prime ministers
Yugoslavia and its successor states are a bit of a mess, and I don’t know how to count them. A king of Serbia was assassinated in 1903, a king of Yugoslavia in 1934 in France and a prime minister of Serbia and Montenegro in 2003