1 Patents are usually not "rejected for examination". Among the three types of patents (invention, utility model and design), only the invention patent is really examined.
If the application is not an invention patent, general authorization is possible (but it does not mean that the authorized patent may be invalid); When applying for an invention patent, if the technical content of the application is almost the same as that of Company A, there is no other outstanding difference. Since the technology of Company A has been made public, the invention is usually not authorized.
Whether to apply for a patent depends on the purpose of company B, the need to promote products, or the real protection? If it is the former, you can apply for a patent for utility model. Of course, you can make some improvements with the patent applied by A when you apply (the product may not necessarily be improved). If you want real protection, unless you make at least one improvement on the patent that Company A has applied for.
You don't need a trademark or even a product to apply for a patent.
I don't know if what I said is in place. If necessary, you can send a message for consultation.