Canada became a self-governing dominion in 1867 , but retains some ties to the British crown .