The Competition and Markets Authority (CMA) said the companies should have issued refunds for the cancelled trips when planes were grounded due to the pandemic.
Investigators will be writing to both airlines and will also look at whether refunds should have been given where flights took place but non-essential travel was banned due to lockdown restrictions.
During the pandemic BA offered vouchers or re-bookings, while Ryanair provided the option to re-book, the CMA added.
Legally, customers are entitled to a cash refund within 14 days.
The watchdog said: "The CMA is concerned that, by failing to offer people their money back, both firms may have breached consumer law and left people unfairly out of pocket.
"It is now seeking to resolve these concerns with the companies, which may include seeking refunds, or other redress, for affected customers."
CMA chief executive Andrea Coscelli added: "While we understand that airlines have had a tough time during the pandemic, people should not be left unfairly out of pocket for following the law.
"Customers booked these flights in good faith and were legally unable to take them due to circumstances entirely outside of their control. We believe these people should have been offered their money back."
The agency added that it should not be assumed either airline has broken the law.
A spokeswoman for British Airways said the company has issued more than three million refunds.
She added: "We continue to offer highly flexible booking policies at the same time as operating a vastly reduced schedule due to Government-imposed travel restrictions, and we have acted lawfully at all times.
"It is incredible that the Government is seeking to punish further an industry that is on its knees, after prohibiting airlines from meaningful flying for well over a year now.
"Any action taken against our industry will only serve to destabilise it, with potential consequences for jobs, business, connectivity and the UK economy."
It comes after the CMA launched enforcement action against several package holiday firms, forcing them to agree to offer cash refunds to customers.