Hi user!
OSPF Domain ID
If inter-area routes are advertised between local and remote OSPF areas, these areas are considered to be in the same OSPF domain.
Important characteristics of OSPF domain IDs include:
- Domain IDs identify and differentiate different domains.
- Each OSPF domain has one or more domain IDs. One domain ID must be a primary ID, while the others are secondary IDs.
- If an OSPF instance does not have a specific domain ID, its ID is considered as null.
Before a PE advertises the BGP routes learned from a remote PE to CEs, the PE checks the domain IDs carried in the BGP routes to determine the type of OSPF routes (Type 3, Type 5, or Type 7) to be advertised.
If local domain IDs are the same as or compatible with the remote domain IDs carried in the BGP routes, the PE advertises Type 3 routes. Otherwise, the PE advertises Type 5 or Type 7 routes.

Routing Loop Prevention
Routing loops may occur between PEs and CEs when OSPF and BGP learn routes from each other.

As shown in
Figure 3, a routing loop occurs in the following process:
1. PE1 uses OSPF to import a BGP route whose destination address is 10.1.1.1/32.
2. OSPF then generates and advertises a Type 5 or Type 7 LSA to CE1.
3. CE1 learns an OSPF route with the destination address 10.1.1.1/32 and next hop of PE1 and advertises the route to PE2.
4. PE2 learns an OSPF route with the destination address and next hop being 10.1.1.1/32 and CE1.
5. CE1 also learns an OSPF route with the destination address 10.1.1.1/32 and next hop of PE2. PE1 learns an OSPF route with the destination address 10.1.1.1/32 and next hop of CE1.
6. CE1 has learned two equal-cost routes, with the next hop of one being PE1 and the other being PE2. The next hops of the routes from PE1 and PE2 to 10.1.1.1/32 are CE1.
The preference of an OSPF route is higher than that of a BGP route. Therefore, BGP routes on PE1 and PE2 to 10.1.1.1/32 are replaced by the OSPF route. The OSPF route with the destination address 10.1.1.1/32 and next hop of CE1 is active in the routing tables of PE1 and PE2.
The BGP route then becomes inactive, causing LSAs generated when this route is imported by OSPF to be deleted. As a result, the OSPF route is withdrawn. There is no OSPF route in the routing table, and the BGP route becomes active again. This cycle causes route flapping.
OSPF VPN provides a solution to this problem.

https://support.huawei.com/enterprise/en/doc/EDOC1000141935/2e3eb6b4/enhanced-ospf-functions
Thanks!