One of the things that people think of when they think of Egypt is Cleopatra. However, she was a member of the
Ptolemaic dynasty, which preserved its Greek ethnicity through inbreeding. That dynasty generally spoke Greek exclusively and worshipped only the Greek pantheon.
The Ptolemaic dynasty ruled Egypt for 275 years. How were the Egyptian people able to accept this? Were the Ptolemaic dynasty able to sufficiently appease the Egyptian people, or were there frequent attempts to overthrow the Greek rulers of of Egypt?
First of all, the Ptolemids did not adopt close-kin marriage in order to preserve any kind of "ethnic purity", I discuss the actual causes of this phenomenon here. Secondly, the Ptolemids absolutely adopted the worship of Egyptian deities as I discuss here in this discussion of the Egyptian practices adopted by the Ptolemaic dynasty and you might also be interested in this older answer of mine on the cultural agenda of the Ptolemaic dynasty. Finally, you will probably also interested in these posts: