Like the title states, is there any way to kill a companion? I ask this because certain companions are a nuisance.
Sort of. There are only three companions you can kill normally: Deacon, Danse, and X6-88.
The way to kill Danse is by following any storyline except for the Minutemen storyline. This will eventually lead to the quest Blind Betrayal, which gives you the opportunity to kill him.
You can kill X6-88 by following any main storyline except that of the Insitute to completion.
For any other companion you wish to kill, you need to use console commands.