Q: Can I make ittikaf in my local masjid or does it have to be in one of the 3 holy mosques?
A: Ittikaf must be made in a masjid that establishes congregational prayer for those required to attend. The masjid includes its expansion, its roof, its fenced courtyard, and its minaret.
If you have vowed to perform ittikaf in one of the 3 holy mosques, you must fulfill your vow and are allowed to do so in the masjid you specified or in a more virtuous one.
Source: Bidayat al-Abid