The use of a one-horned animal in allegory and heraldry is extremely long and may go back several thousand years ago where depictions of such animals can be found in the Indus Valley culture. Similar animals were written about in Ancient Greece as living in India and Persia, and The Roman writer Pliny the Elder wrote about an animal he called a monoceros, but was more likely a rhinoceros. In Physiologus, an early christian text, the authors outlined the moral attributes of animals, plants and even stones. The unicorn was depicted as a wild and untamed creature which could only be subdued by a Virgin (Mary) and it was this that led to its symbolic depiction in religious art.
In medieval times it was used as an allegory in courtly terms, symbolising love and chastity, the opposite of the war-like lion. It was this opposition to the lion - which England had chosen as its emblem in the 13th century - that led to Scotland using it as its symbol and why both are used in the UK Royal Coat of Arms - though there are actually two different versions. One used in Scotland has the unicorn on the left and both animals crowned, whereas the one used in England and Wales has the lion on the left and only that creature crowned.
In today's less religious society, the unicorn's symbolism now represents unreachable fantasy, something that is dreamed or longed for but ultimately unattainable. Most recently used in relation to Brexit.