If you are referring to physical stacking and if it is an MS210, MS225, MS250, MS350 or an MS410 you use the stacking ports on the back. They are the only ports you can plug into.
The MS425 has flexible stacking, so you can use ports on the front, but you would normally still use the ports on the back.
If you are referring to virtual stacking you can connect them anyway you want.
Here is an article about stacking:
https://documentation.meraki.com/MS/Stacking/Switch_Stacks