Germany became a unified country, only in 1876. For Italy, 1871.
Before then, both were comprised of bits and pieces. Bavaria being one. Prussia another.
If Bavaria wants out, over excessive uncontrolled immigration, I fully support them.
There are many movements for historical cultural/language regions to become "autonomous." Catalonia, Scotland, etc.