how the mysql server settings replicatd in innodb cluster
Yes, you have to change the variable on every node, and if you want the change to be permanent, then you also have to change the relevant options file (e.g. my.cnf).

innodb_buffer_pool_size is dynamic (since MySQL 5.7), so at least you don't have to restart the nodes for the change to take effect:

SET GLOBAL innodb_buffer_pool_size=402653184; 


(Don't forget to also set the value in the options file so it becomes permanent, i.e. so the change survives restarts.)

EDIT

If you're using MySQL 8.0+ then there's a handy feature that allows you to set a global variable and persist it to a special options file:

SET PERSIST max_connections = 1000;


See the SET syntax documentation for more details.