I have something like this in my ERD.

Note that there can be two rooms connected by more than 1 door. Translating this in tables I get that every couple door-room is repeated twice (One time as entry and another time as exit). So I simplified my ERD schema like [this]

Where room1 and room2 are foreign keys.
During lecture we never saw an '' Ãsolated '' (without relationships) entity but browsing here on Stack Overflow i saw someone saying that was possible and correct.
Is my solution above correct?
Yes, there can be isolated entities in a diagram.
But your corrected diagram is incomplete: it gives the impression that the entities are isolated whereas they are not; doors and rooms are related and the relationship should appear.
If you'd correct this relation, you'd have something similar to the first diagram, but instead of
INandOUT, you'd haveBETWEEN 1andBETWEEN 2.You would then immediately notice that your design is not fully equivalent to the original one: the original design allows to represent unidirectional doors. This sounds strange, but if you go in large office buildings, you'll see for example that:
The original design requires many duplicate doors because of the unidirectional design (this facilitates graph exploration algorithm). You could still achieve the same expressiveness, by adding either two attributes
from_1_to_2andfrom_2_to_1or a single attributedirectionwhich could have three values (unidirectional from 1 to 2, unidirectional from 2 to 1, or bidirectional, the encoding is left as an exercise).This revised design would be superior to the original design, since it would prevent redundancy, and facilitate normalization if other information about doors need to be recorded (e.g. material, type of lock, fire resistance, automatic closing or not, serial number, etc...).