Upvote:5
You are a national of Hungary and wish to travel to the United States, but your ESTA application to travel to the US under the Visa Waiver Program was denied because you have been previously denied a US visa.
According to the US Customs and Border Protection, if your application for an ESTA was denied, you must get a visa if you wish to travel to the United States. It does not matter if you enter by land, sea or air, or via Canada, or what the purpose of your visit is.
The only exception to this is if you had applied with a passport number that was lost or stolen. In this case, you would need to replace the passport and reapply for the ESTA with the new passport number. But this exception does not apply to your circumstances.
Note also that Canada is not the United States and has its own requirements for traveling there. Your status in the US has little bearing on whether you can enter Canada, but even if you are admitted to Canada you still will need a visa to enter the US.