You can add stocks whenever you put money in. Whether that's because you got your paycheck or a dividend or some other income is kind of irrelevant. And you can remove stocks when you take money out. But you probably shouldn't start selling one stock to buy another just because their prices moved, unless you have information that lets you time the market.
But then you wind up with a portfolio that isn't balanced and isn't tracking like an index fund. An index fund doesn't simply buy a flat amount of stock and hold it, they buy stock in proportion to the relative weight of the exchange. Which is always moving
Market cap weighting is special. If company A has 500 shares, company B 500 also, than a fund that has 5 shares of A and 5 of B is market cap weighted.