Hi,
This can be achieved through 'Source List'. In the source list you can maintain 'Supplying plant', so, maintain source list with the supplying plant as the plant of different company code and set the block indicator. System will not allow to use STO with the source list plant combination. But this will not only block '301' but also all type of STO. If you are ok with this then you can use source list option.
OR
Use user exit MB_CF001 or MBCF0005 to validate company code of the plant. You can write your own logic, for ex. if movement type is '301' and if the entered plants belongs to same company code then allow user to post the document and if they belongs to different company code then issue an customized error message. You can use table T001K for validation of company code and plant assignment.