If I'm not mistaken, the Holy Roman Empire was designed to protect, and to a certain degree hold peace within its borders. What would the reaction inside the empire be if the elected emperor, Charles V as an example, would forcibly annex one or more member states? How would the HRE members react, and what actions would be done? How would this differ from an outside country, like France, annexing territory that was in the HRE?
A reply to /u/WhoNeedsFacts
This actually did happen. Charles V claimed the Duchy of Milan, a member state of the HRE, following the Italian wars of 1521-1526. The war started with Imperial-Spanish forces fighting against the invading French under Francis I. The Imperial forces prevailed, and appointed Francesco II Sforza to be Duke of Milan in 1521, as the Sforza family had recently become dukes of Milan.
In reality, Francis I had a dynastic claim to the Ducal title. The Visconti family ruled the Duchy of Milan for a long time, and they mostly adhered to the interests of the HRE. However, the first Visconti duke of Milan married into the French royal family, and the marriage agreement was such that if the male line of Visconti were to end, then the title would be bestowed upon the Duke of Orleans. So, Francis argued that the Sforzas were usurpers.
Francis I didn't want to give up on Milan so easily, so he invaded again and was able to take Milan from 1524 to 1525. However, at the Battle of Pavia not only was Francis' forces defeated, he was personally captured in battle. So in 1525, Francesco II Sforza was restored to his title. When he died in 1535, he was heirless, and the Sforza family had been exhausted after decades of war against France's Louis XII and Francis I.
There were several ideas considered as to what to do with the Duchy of Milan. One was to give it as a reward to Charles de Bourbon, who had defected from the French due to Francis dispossessing Charles de Bourbon off his inheritance. Another was to give it to Ferdinand the brother of Charles V.
Eventually, it was becoming clear that Charles V wanted Philip II his son to inherit the Low Countries. The Imperial chancellor Gattinara then came up with a scheme by which Charles would claim the Duchy of Milan in order to have a line of communication from Spain to Milan to the Low Countries, eventually becoming the Spanish Road. So Charles made an agreement with Pope Paul III to create a Duchy of Parma for his illegitimate son, cut off the southern part of the Duchy of Milan.
The Sforza family then tried to ally with France to go against the wish of Charles V, but given their weakness and France's weakness, this went nowhere. To my knowledge there was no discussion at the HRE level, which makes sense given that defending a weak family that had no chance of either re-gaining their territory nor defending it if they did, was simply not smart. Plus, the specter of French encroachment onto Milan was very real and both Charles and Gattinara played it smart and aligned their interest with that of the Pope.
More pragmatically, Charles ordered significant improvements to Milan's fortifications, rendering it impregnable to anything short than a long, dedicated siege. So he was then able to invest the Ducal title of Milan to his son Philip II.