It was founded by Roman refugees when the WRE was still alive and later on became a part of the Eastern Empire.
Actually, it's really, really disputed.
Venetian foundation seems to have been made in the long run, as laguna was used as refuge point even in the Late Roman Empire without lasting settlement : during Ostrogothic's rule, it seems that where is Venice today, were only some fishermen hamlets.
The tale about Aquilea and Attila must be considered as a rationalisation from Venetical classical medieval historiography, and even if you could have some pre-Venice from the Vth century already, it's more likely that the basic foundations are issued from the Lombard invasion of Italy.
Not that you had ONE unified city, even at this point (there's a reason if it's called Veneti
ae : each island had more or less its own, and the urban/political center wasn't always the Rialto, but, for exemple : Eraclea (in the early period), Malamocco, then Torcello.
How did Venice see itself in relation to Rome early on in its independence
It's hard to really give a date for its independence. The first doges that Venetian historiography remember were actually byzantine nobles from the Exarchate (and maybe exarch or magisteri militiae of Ravenna)
(Doges is a deformation of "dux" a more or less vague title meaning "leader". It could be a formal title, but I'd think, giving how it's used in Early Medieval Europe, that it's just a convenient way to name a leader that eventually lasted formally)
This political isolation gave more autonomy to a territory without making it independent : Orso Ipato (
hypathos) was acknowledged by Constantinople.
During the VIIth/IXth/Xth century, what you have is probably a growingly important Venetian identity, not hositle to Byzantine but separate. Frankish pressure may be one of the reasons : before the big blue blob and its successors, Byzantine support was a safe tool for keeping this autonomy.
Eventually, this relationship worked in both sense, as Venice was Constantinople's door in Latin Christiendom, and a growingly naval auxiliary. It made Venetians, from the Xth onwards, beneficing from important advantages that Constantinople gave to what they percieved as part of their empire.
But in fact, from the IXth, cultural (Latinity), religious (especially the Roman religious obedience) and political differences, coupled with a growind Venetian identity (as Venetians hijack Marc' reliques from Egypt, which is a way to mark its predominance), Venice can be already considered as largely independent.
Eventually, the formal division between Latin and Greek christiendom in the XIth could be seen as the formal separation. between Venice and Byzantium.
Basically, from what we know or think we know of Early Venice : we may have an already quite strong (and growing) sense of particular identity, with Roman Empire being a true but far master. Maybe not unlike a pioneer spirit, from a laguna at the edge of an Empire that let them do as they saw fit.
Would the comparison with North American colonies of the British crown at their beggining stand? Probably false in many regards, but I think it would be close enough to what could have existed.
I ask because it seems strange that former territory of the Empire could become so hostile to Rome without having a weaker cultural memory of Imperial control.
Well, Venetian historiography was re-written a lot to take in account that : earlier foundation, myth of independence since the VIth century.
Classical and Late medieval Venice tought itself as Venetian before everything else : while important families took pride descending from Byzantine nobles, it's more of a patrician thing than a Venetian thing per se.