Yes, you are allowed to do that, e.g.
In [1]: import networkx as nx
In [2]: square = nx.Graph()
In [3]: square.add_cycle([1,2,3,4])
In [4]: triangle = nx.Graph()
In [5]: triangle.add_cycle([10,20,30])
In [6]: shapes = nx.Graph()
In [7]: shapes.add_edge(triangle,square)
In [8]: shapes.edges()
Out[8]:
[(<networkx.classes.graph.Graph at 0x962040c>,
<networkx.classes.graph.Graph at 0x962042c>)]
In [9]: shapes.nodes()[0].edges()
Out[9]: [(1, 2), (1, 4), (2, 3), (3, 4)]
In [10]: shapes.nodes()[1].edges()
Out[10]: [(10, 20), (10, 30), (20, 30)]