Will an iPhone work in Hungary?

I'm thinking about sending my friend my old iPhone once I get a new one but would they even be able to use it there?

What cell network do you have? Phones are non transferable between networks. Meaning an iPhone you got from sprint can never be used as a Verizon phone or vice versa.

Knowing that it's unlikely it will work unless it is jailbroken

Depends on if it is unlocked or not so it could work with any carrier.