Examples of application of theories to completely unexpected structures? AFAIK, every mathematical theory (by which I mean e.g. the theory of groups, topologies, or vector spaces), started out (historically speaking) by formulating a set of axioms that generalize a specific structure, or a specific set of structures. 
For example, when people think of a “field” they AFAIK usually think of $\mathbb R$, or $\mathbb C$. A topology started out as a concept defined on $\mathbb R^n$ if I’m not mistaken. 
But I’ve also seen cases where a certain structure has a natural  topological structure, such as certain sets of propositions in first order logic. As far as I know, the people who formulated the axioms of a topology had no idea of this application. And the topological structure of a set of FOL statements is certainly conceptually vastly different from one on $\mathbb R^n$, certainly not two structures I would have expected to have such a deep commonality.
I would like to make a list of examples of mathematical structures that


*

*Are interesting and well-behaved structures (e.g. not mere pathological counter examples)

*satisfy the axioms of some mathematical theory in an interesting and nontrivial way,

*But whose emergence is (conceptually/historically) very different from the structure of which those axioms were originally intended as a generalization.
 A: The useful Zariski topology in algebraic geometry satisfies the usual axioms for a topology in  a context that doesn't really match "the structure of which those axioms were originally intended as a generalization".
A: Several significant examples from mathematical physics:


*

*The usefulness of Hilbert space in the formalization of quantum
mechanics.

*Riemannian manifolds as the appropriate language for general
relativity.

*Calabi -Yau manifolds come up in string theory.
Calculus for Newtonian mechanics doesn't count because the wish to formalize mechanics was much of what led Newton to invent calculus.
A: The Peano's arithmetic was thought to axiomatize the structure of natural numbers. However, exists the structure of non standar naturals where exists a biggest natural number and satisfies that axioms. 
A: Number theory (the "structure of the integers") had no applications for years - a fact that particularly pleased G. H. Hardy. 
Now it's central to cryptography: prime factorization, discrete logarithms, elliptic curves.
See https://crypto.stackexchange.com/questions/59537/how-come-public-key-cryptography-wasnt-discovered-earlier
(Not sure this counts.)
