Well the show is dubbed into different languages, so it makes no sense that they just speak English,
Why? Anime gets dubbed in a lot of different languages too, but we take for granted that a setting is supposed to use a certain language. E.g. Durarara!! characters reasonably speak mostly Japanese, since it's set in Tokyo, but since Baccano! is set in America, we would assume they're intended to be speaking English.
It would be difficult for them to invent a complex fantasy language, and then put subtitles on it.
Well, it's a lot of work, but it's certainly not impossible. Klingon in Star Trek and Elvish in Lord of the Rings are good examples. You also don't need to have them speak the language full time, for an extended scene you can establish that's what they're speaking, & then dub it with English.
But then I wonder, if the film is showed in Spain, what would happen?
It depends. Dubs of foreign movies do exist. For example, there's an option on Netflix to play a dub of the live action Fullmetal Alchemist movie. I don't know why you would, since it's a terrible film, but it's there.
I think the main character should speak whatever country the film is showed in, so what if France is where the main character lives and where the story begins? A) They speak French, and it has Spanish subtitles, and the Spanish speak Spanish B) French and Spanish people both speak Spanish C) French people speak Spanish and the Spanish speak a different language, but that would make no sense, because the movie needs to be historically accurate, since it is a historical movie What do you think?
I think it's a pain in the ass. If I was in the mood to read, I'd pick up a book.
I saw almost all Star Wars episodes, each of them just once, I did not really understand much of the story. I also saw that there are fantasy languages with subtitles. The main characters speak a real-life language and some alien characters speak to them in fantasy language and the main character responds in the real-life language. What do you think about this?
I don't know about that show in specific. I did say that fully speakable fantasy languages exist, but it's also more common to just dub a scene with gibberish & put subtitles over it to create the illusion that the aliens are speaking some alien language.