Was Finland an Ally in World War 2?

Not exactly, but Finland was a special case. Finland had once been a part of Russia and had only been an independent nation for a relatively short time, historically speaking - a few generations. The border between Finland and the Soviet Union (Russia) was not very far from Leningrad (St Petersburg), the Russian city built as a "window on the Baltic Sea" and to be a national capital. The Soviets had moved the capital back to Moscow but coveted Finnish territory near St. Petersburg. For two years, Hitler and Stalin were partners, from the signing of the Non-Aggression Pact between them in late August, 1939, which cleared the way for Germany to invade Poland - the step widely regarded as starting WWII - and the German invasion of Russia in June 1941. During those two years Hitler and Stalin were busy invading any country they chose and gobbling up their neighbors, and Hitler invaded eight countries while Stalin invaded five. But, Hitler was more successful as a conqueror than Stalin. But Stalin felt free to invade Finland and start a war to obtain the land he coveted in the vicinity of St. Petersburg. This was called "The Winter War". The only problem was the Finns proved surprisingly tough with their tiny army of only eight divisions, and the ensuing fiasco was a tremendous embarrassment to Stalin. Stalin had just about two years earlier killed more than half of his own army officers of the rank of colonel or general in a great purge, and the professionalism and ability of those slaughtered professional officers was sorely missed during the Winter War. The difficulties of the Soviets in handling teeny tiny Finland, and the incompetence displayed by their army, probably encouraged Hitler to proceed with his plans to betray his partner and turn on the Soviets, before they could regain a minimal level of competence militarily.

And when Hitler did turn on Stalin, he received enthusiastic assistance from the Finns, who were eager to regain their little bit of lost territory and give the Russians another black eye.

Allied leaders understood the circumstance which had led to Finland fighting on the side of the Germans. No one in the west cared for Stalin and his communist regime, and he was only allied with Britain and the US because Hitler had invaded Russia, on the principle that "me enemy's enemy is my friend". Two weeks after the Germans had invaded Poland in 1939, pursuant to their secret agreements with the Soviets, the Soviets also invaded Poland, from the other side, and Germany and Russia divided up Poland between them. While Britain and France had declared war on Germany for their first invasion, two weeks later nobody declared war on the Soviet Union. I suppose Britain and France felt there would be time enough to deal with Stalin when, and if, they had defeated Hitler. But Stalin's greed and aggressiveness weighed in Finland's favor with the western Allies, and they agreed that Finland would not be treated with the harshness intended for the other minor allies of Germany (none of whom had much realistic choice in that alliance).