Where are we from? What if someone else applies for a patent for an invention product?

If others have nothing to do with you, then there is no way but to apply. Patent application comes first, first come, first served; You can claim priority in the future.

If someone else has something to do with you and there is a question of the right to apply (that is, who has the right to apply), you can go to court. This is a patent dispute.