It depends on which plan you have first. Generally, if you already have COBRA when you enroll in Medicare, your COBRA coverage usually ends on the date you enroll in Medicare. Your employer has the option of canceling COBRA at this time. If you already have Medicare when you become eligible for COBRA, you must be allowed to enroll in COBRA. But, if you are only enrolled in Part A be sure you understand what the rules are for enrolling in Part B or you could have to wait for a general enrollment period, and the cost of Part B may go up.
However, there may be different rules depending on your state. It is always a good idea to check with Medicare, your former employer and your state insurance department to make sure you fully understand how COBRA works with your Medicare coverage and what happens when your COBRA ends.