Hiya!! So I'm not entirely clear what period or case you are referring to, but by and large there were no "countries" that were partly in the Holy Roman Empire (focusing on the late medieval/early modern period). Most of the cases I know of are personal unions, where two different territories had the same ruler as their head of state/government so to speak. So the Valois Dukes of Burgundy in the 14th and 15th centuries held the titles of Duke of Burgundy (in France), Count of Burgundy (in the HRE), the Count of Flanders (in France), Count of Holland (in the HRE), Duke of Brabant (in the HRE), Count of Artois (in France), etc. This functionally meant the one person was at the head of the military and political administration of all of these regions, and, at least in theory, had different obligations to different overlords for each of these regions. This would crop up again in later periods, as the Habsburgs would control the Archduchy of Austria and the Kingdom of Bohemia inside the Empire, but the Kingdom of Hungary outside of it. It would happen again with Brandenburg-Prussia, with the former within the Empire and the latter outside of it (hence the unwieldy title King in Prussia).
What this meant on a practical level varied. I can't really do too much on the later cases of Brandenburg-Prussia or the Habsburg lands, though they may better fit your example. Prussia formed and absolute monarchy, but by that point, the Holy Roman Empire really didn't have any real semblance of centralized control to prevent them anyway. As far as Burgundy and the Low Countries go though, the Valois-Burgundy (the dynasty that ruled these territories) often experienced revolts insurrections in their territories, which had separate courts, laws, bureaucracy, and assemblies. This by and large meant that the local infrastructure remained intact and that is what determined the differences between regions as well as determined freedom of movement. Given that France and the HRE were both in periods of turmoil and weak leadership, the Valois-Burgundy attempted to centralize the administration of their holdings to try to make it function like a single entity, with Philip the Good calling a Estates-General for all of his territories together in Bruges in the 1460s. This effort eventually failed as the dynasty died out under Philip's son, but the attempt was made and by and large there wasn't a lot the Emperor could really do about it in this case.
Does this help? I know I could really only go in depth on one example, but let me know if you have any follow-ups or want additional information about the Burgundy example above.
Sources:
The Promised Lands: The Low Countries under Burgundian Rule by Wims Blockman and Walter Prevenier; published 1988 (worth noting that this work was written by Dutch authors and thus is in translation, which makes it a bit of a pain at times if you aren't reading it for a class or paper :D or if you don't read Dutch)
Philip the Bold: The Formation of the Burgundian State 1384-1404 by Malcolm Vale published 2005