actually definition above is not completely true. i believe that definition is given in goldstein's book.
but in that logic, you can not distinguish one dynamical system from another. (Both have canonical looking equation) So if you write down two equations and start claiming both of them are for one dynamical system, then with your logic you there is no way to refute them. for example, harmonic oscillator has canonical variable q,p, and Hamiltonian H. say, gravitational system has P,Q, K. Then obviously P,Q,K are not canonical variables and Hamiltonian for harmonic oscillator. But according to above definition, they are.
Additional element to complete the definition is that you should have generator F, that connects two sets coherently. So you should think of canonical variables as a member of family of variables with Hamiltonian satisfying Hamiton's equation AND connected with each other through fenerator F.