Is database performance optimization independent of the size of a database or a table?
There is no definite answer. It really depends on the data and the change you have performed.

For instance, if you created an index that helped in the 100,000 records table, in many cases it will help with the 10,000,000 records table.

However, if, let's say, you had a cursor and you've rewritten it to a set based solution, it will be good enough for the 100,000 records table, but not good in the 10,000,000 records table because there is no supporting index for the query.

The best thing to do is to monitor the system as it grows and see if queries keep running fast or degrade, and fix accordingly.