Ive seen many maps of the HRE and in almost every one Hungary is outside of the empire but still owned by Austria. Similarly East Prussia was not considered part of the empire (or the German Confederation apparently) even when it became connected with west prussia
The HRE was not a country in the modern definition. It was a system by which member states relate to each other, and to institutions that comprise the HRE. There was the Imperial Estate and the Imperial Diet, under which the Council of Electors voted for the King of Romans and eventually directly the Holy Roman Emperor.
There were Imperial Courts, and Imperial Circles for administration. To some degree they group members states for defense and taxation.
Going back to your example of Austria as a member state and Hungary not being a member state, the more precise statement is that Ferdinand I, Archduke of Austria, inherited Kingship of Bohemia, and those of Hungary and Croatia. Thus, his descendants (in the House of Habsburg) were able to maintain the inheritance of the Archduchy of Austria and the Kingdom of Hungary for a long time.
Until such time that Austria-Hungary was further united under the Austrian Empire and then the Austro-Hungarian Empire, the joint head of state ruled each territory according to its own set of rules. So going back to Ferdinand, he acted either as Archduke of Austria, or King of Hungary, or in some cases as both, but not always as both. This was not uncommon in that time.
To give another example, Ferdinand's brother Charles V was Holy Roman Emperor, King of Castille and Leon, King of Aragon, Count Palatine of Burgundy, etc etc etc etc. When dealing with HRE matters, he had to address the Imperial Estate. When dealing with Spanish matters, he had to address the Castille e Leon cortes and the Aragon cortes separately. And so on and so forth. Of course, he was able to leverage the position in one to gain advantage in another, such as when he asked for money from Castille e Leon in order to support his bid for HRE emperorship. But he still had to do so in a manner dictated by the system of governance in Castille e Leon.
To help understand the HRE, you may want to read through the FAQ section. There are several outstanding threads that discussed the question of the HRE's crazy borders, how it was administered, etc.
http://www.reddit.com/r/AskHistorians/wiki/faq/europe#wiki_the_holy_roman_empire
http://www.reddit.com/r/AskHistorians/comments/v4ni6/im_confused_on_the_holy_roman_empire/
http://www.reddit.com/r/AskHistorians/comments/2fcrxo/how_did_the_german_principalities_of_the_holy/
Usually those territories were held by the ruling family of the German principality but weren't a part of the principality/kingdom/bishopric etc that was part of the HRE. The most common case was personal unions. For instance the Duchy of Prussia was not part of the HRE but was held in personal union by the rulers of Brandenburg, whose Brandenburgian lands were a part of the Empire.
This later led to an obscure event where after a period of Prussian growth and success, the ruler of Prussia-Brandenburg started to get ideas above his station and wanted to be recognised as a King, equal to his perceived power status. Traditionally there is only one kingdom in the HRE, that being the Kingdom of Bohemia, which was held by the Habsburgs, who also happened to be the Holy Roman Emperors and one of Prussia's biggest rivals. As a result of the power struggle between the Habsburgs and Hohenzollerns (Prussia-Brandenburg's ruling family), the Emperor refused to recognise the King of Prussia as a king within the HRE. Instead a new title was adopted and given to the rulers of Prussia-Brandenburg, that of King in Prussia. This might sound like mere semantics but it's important because it means that when in Prussia the Hohenzollern ruler was recognised as a King and when dealing with international matters he was recognised as such. However when dealing with internal HRE matters, he was recognised by his lesser Brandenburgian titles and was thus very clearly inferior to the Emperor, subordinate to him and his old feudal obligations were made clear.
It's similar to the Great Britain-Hannover relationship, they were in personal union but Great Britain was never a part of the Holy Roman Empire, as Britain and Hanover were separate sovereign countries. Austria and Hungary and Saxony and Poland are other examples of this happening. Thus when the British monarchs were dealing with internal HRE affairs they were the Elector/Kings of Hannover but if the King was writing to the Holy Roman Emperor about British-Austrian cooperation against the French, he was writing as a King to the Emperor.
I'm not sure whether it was possible to apply to join the HRE and bring your new lands into it, someone more knowledgable than me will no doubt know that, but I can't remember any example of that actually happening. You'd need the political support of the establishment in those lands to start with and as we've already established having lands outside of the HRE and Emperor's influence could actually be very useful for a German ruler. The only changes in HRE membership I can remember off the top of my head are Northern Italy, Switzerland and the Netherlands leaving it.