Macbeth is only referred to by that name throughout the entirety of the play, and we are not directly told if that is his first or last name. However, because his wife goes by Lady Macbeth, it is reasonable to assume that Macbeth is their last name. At that time, it was most common for a noble woman to be referred to using her husband's last name, with the addition of the title “Lady” to indicate her high social standing, rather than simply being referred to by her first name. This is an example of the fact that women were often viewed as property at this point in history.
King Duncan does not have a female counterpart, and therefore we cannot make as much of an educated guess about his name as we can Macbeth’s. One might argue that because Macbeth is a noble and is referred to by his last name, it must also be true for King Duncan, because his noble ranking is much higher than Macbeth’s. Because Duncan is also a Scottish surname, meaning that people with that last name originated from the Duncan clan, one might again assume that Duncan is the king’s last name.
With both characters, we are not definitely told if their names are their first or last. We can use context clues given the social climate of the time period, but these educated guesses are not definitive answers.