Can I apply for a patent if I produce the same product as someone else?

No. Patent rights have uniqueness, exclusivity and novelty. If someone else produces the same product, it has lost its novelty and cannot apply for a patent again, so it is no longer possible to apply for a patent. The patent system is a legal system for protecting intellectual property rights of inventions and creations under market economy conditions.