Oh for sure. I’d be surprised if theres not an app out ther for it - theres an app for everything!
I would say yes for Android and yes for IOS (if it’s jail broken)
My iPhone isn't jail broken, and I use the app Aloha to download videos. It doesn't always download copyright stuff though, eg from YouTube.
My old iPhone 4 had an App called "Free Video" but it's not supported on later iPhones running 64 bit iOS systems. "Free Video" is also no longer available in the App store either. It was a brilliant App and would record absolutely anything you wanted.
There is another way on iPhones though. Just use the screen record feature. You'll first need to enable it, if not already done so by going to Settings > Control Center > Customize Controls, then click the + symbol next to Screen Recording.
Come back out to the phone's main screen, and if you want to record from an App, simply double click the home key, swipe up and press the record icon. You can chose whether you have the sound on or off by holding your finger on the record icon and selecting mic on or off.