I am currently writing my first book set in the first years of WWII, however, the main character is fighting for a country (allied with the Axis) which did not take any military action of their own until they switched sides in 1944. I could change the setting (probably to WWI) and the book, for the most part, will stay the same, however, it would be preferable to remain in WWII. Should I change the setting to be more historically accurate or no?
Is this an alternative history, or an actual one? I suspect you'll have a bit of leeway if you're writing alternative/fantasy history of what MIGHT have happened if something had been different. However, if you're writing a historical novel that's supposed to be accurate, make it accurate. It's a period of history that people who are still alive actually remember, so your leeway for invention is very small. As a reader (and writer) of historical fiction, I can say that as soon as I run across something I know is wrong, it makes me doubt the author. Then every fact or occurrence they write about afterwards makes me suspicious that they don't know what they're talking about. It can also mean the author was too lazy to find out what really happened, so they just made it up or handwaved the details, or even fit in details they knew were wrong for the period, simply because it made a 'better story.' And yes, discovering these anomalies does make the book less interesting for me. There is nothing better than reading a historical novel that has been thoroughly researched. You become immersed in the 'real' past, and not some fairytale version of it—at least as far as any kind of fiction can go in that direction.
Also, citizens from neutral countries would sometimes join the fighting out of ideology. For example, even though Spain was 'neutral' they did send a group of volunteers to fight for the Axis. There were American citizens of German descent who joined the German military. These are two of many, many examples. While I do not know the details of your setting, I'll bet there is a good chance that the nation and individuals were evolved in the fighting long before any formal declarations were made.