The fact that there may be a city rather than airport code, e.g. NYC vs. LGA, JFK or EWR, is irrelevant. What matters is why OP is asking and what he wants to accomplish.
May he book a ticket LGA-XXX-JFK? Of course. Will it be the same price as LGA-XXX-LGA? Depends on the fare rules for the specific ticket.
Thus, lest OP receive the right answer to the wrong question, it would be helpful to hear what he really needs to know.