The defeat minimises Slovenia's chances to make it to the tournament, which will be hosted by Denmark and Germany, but the team is determined to do its best as it plays a return match in Hungary on Wednesday.
Handball player Vid Kavtičnik said it would be difficult but not impossible to make up for the five-goal difference at next week's qualifier.
"But we'll have to put on a spectacular performance in Veszprem, both defence and attack will have to be at a much higher level," he said after the game in Koper.
Coach Veselin Vujović regretted the team had failed to put on a strong defence, admitting Slovenia did not respond adequately to Hungary's rather aggressive playing.
"Our attack was [also] rather weak, more similar to basketball, lacking serious shots from external positions," he said.
Hungary's rough playing also resulted in circular runner Matej Gaber sustaining a serious eye injury, so it is not yet clear whether he will be able to play the next qualifier.
At the World Championship in France last year, Slovenia won bronze, their best result from a total of eight appearances at world championships since 1995.
The team finished eighth at this year's European Handball Championships in Croatia.