While I'm only adding to the choir of people telling you "of course," since I'm directly the person you're responding to it still feels worth saying: yes, of course, if America and Venezuela went to war, it's completely legal for Venezuela to attempt to kill the U.S. President.
As an American, I certainly hope they would fail. But do I think it's legal? Yes: it's a targeted strike on the leader of an enemy country they'd theoretically be at war with. Do I think it's wise? Well — no, Venezuela has a much smaller military, and assassinating the U.S. President would trigger a massive war that would devastate Venezuela for decades while modestly inconveniencing American taxpayers. But legal? Yes.
Well you need to actually think about what you're saying here. Suppose for example China/Israel/whoever is the first to invent really, really great drones (like the size of a bird or even a bumblebee) that are lethal.
So then China could, at any point, call up the US president and say "Look there's a drone in the room with you right now. Shut down all your nuclear facilities or I hereby declare war and you're dead within 10 seconds." Then failing that they could hit the VP next, Secretary of state, etc etc.
Point being the idea of sticking with WW2 "rules" with current and future technology is laughably implausible.
And I guarantee you the citizens of Israel would NOT think it's perfectly legit, legal, and fair if Netenyahu got assassinated with a drone along with his military commanders.