The answer is maybe. Normally you can screen mirror your android device to the Chromcast or if the app you are using (YouTube) has cast capabilities you can cast to your TV. But sometimes the content provider will block casting so you can only watch on your device that has the app installed.
For Apple products, depends on the app. Android and Apple have competing systems so they don't always work together. Your better bet for an Apple product (iPhone or iPad) to cast to a TV would be an Apple TV box.