Can 「気{き}づく ("to realize")」 be used with the quotative 「と」?
Yes, it definitely can.
Why so? Because in Japanese, the quotative 「と」 is used with far more verbs than English-speakers might associate with upon hearing/seeing the word "quotative".
Those verbs include:
・言{い}う "to say"
・話{はな}す "to speak"
・聞{き}く "to hear"
・書{か}く "to write"
・思{おも}う "to think"
・感{かん}じる "to feel"
・教{おし}える "to teach"
・気{き}づく "to notice", "to realize"
There are many more. Crazy, isn't it?
But did he not realise "if he was a foreigner", or that "he was a foreigner" just enclosed with the と particle?
The latter. My TL would be:
"Lewis's Japanese was excellent to the extent that 太田先生 did not even realize that he was a foreigner."
If this helps, 太田先生も外国人だと気づかなかった = 太田先生も『外国人だ!』と気づかなかった. If imaginary quotation marks seemed to make sense for the word/phrase right in front of 「と」, you could be sure that it is the quotative 「と」.
In other words, 太田先生 thought that Lewis was a native Japanese speaker.