How was it possible for Sailor Moon to be referenced in Codename: Sailor V?
Codename: Sailor V first appeared as a one-shot on August 3, 1991.
The actual manga was then written pretty much simultaneously with the Sailor Moon manga, which started only a few months later (December 28, 1991) and which was updated much more frequently.
It even ended later (July 3, 1997) than the Sailor Moon manga (February 3, 1997).
That allowed for the cameos between the series.
Sources:
Codename: Sailor V Wikipedia
Sailor Moon Wikipedia
Sailor Moon Wiki