Both Germany and Italy supported the nationalist, right-wing rebels in the Spanish Civil War.
In the 1930s, rightists in Spain were concerned that Spain was headed towards socialist revolution. Because of this, the army in Spain and in Morocco (part of which was a Spanish colony) rebelled in an attempt to take over the government. At this time, both Italy and Germany were, of course, ruled by fascist dictators. Fascists are to the far right in political terms. They are very much opposed to socialism and communism. For this reason, both Germany and Italy sent troops and air forces to Spain to help the nationalists. They helped to do things like ferrying rebel troops from Morocco to Spain. German involvement in the war is most connected in history to the use of the German Condor Legion which bombed Spanish cities, the most famous of which was Guernica.