The captain (or pilot-in-command) of an aircraft generally has the authority to take any reasonable action (or direct crewmembers) to ensure the safety of the aircraft, including restraining a passenger, refusing to board the passenger, or removing the passenger from the aircraft. In that regard it's similar to a ship's captain.
Read up on the Tokyo Convention, a treaty signed by most countries which covers the authority of the captain and crew to take necessary actions when someone on board has committed (or is reasonably believed to be about to commit) a criminal offense or act that jeopardizes the safety of the aircraft, on international flights. It also addresses jurisdiction for offenses on board.
For domestic travel, most countries have aviation regulations addressing authority of the pilot in command for the operation and safety of the aircraft and they tend to be similar to the Tokyo Convention principles. The Federal Aviation Regulations are the governing regs in the US. Other laws may apply depending on the circumstances of course.