there is nothing in common between Hungarian and Finnish

There is relation between Hungarian and other Ugric languages (mainly Khanty, Mansi). Ugric languages are in turn related with Finnic languages (mainly Finnish and Estonian).
That is why it is called Finno-Ugric language group, which scientists divide into two subgroups, Finnic and Ugric.
As they are related, it is much probable that they originated from dialect(s) spoken by the same group of people millenia ago.