"Article 10 1. Where it is established, on the basis of proof or circumstantial evidence as described in the two lists mentioned in Article 18(3), including the data referred to in Chapter III of Regulation (EC) No 2725/2000, that an asylum seeker has irregularly crossed the border into a Member State by land, sea or air having come from a third country, the Member State thus entered shall be responsible for examining the application for asylum. This responsibility shall cease 12 months after the date on which the irregular border crossing took place."
Therefore the first state entered is responsible for the registration and then for the application for asylum.
And no, the Dublin regulation doesn't state denial of freedom of movement. But they never had such. The Schengen law is only valid for members of the European Union. Everyone else has to get a visum. They were legally not allowed to enter Hungary in the first place, why would they be allowed then to enter another state without getting asylum first?