Stacking dependent ferroelectricity and antiferroelectricity in quasi-one-dimensional oxyhalides NbOX3