One method is to start with a row for each day and then use a corrected subquery. Let me assume you have a calendar table:
select c.date,
(select count(*)
from t
where c.date between t.startdate and t.enddate
) as num_active
from calendar c
where c.date >= '2021-03-20' and c.date3 <= '2021-03-23';
If you don't have a calendar table, you can construct one on the fly for the query -- assuming you have a table with enough rows. For instance:
select c.date,
(select count(*)
from t
where c.date between t.startdate and t.enddate
) as num_active
from (select date( '2021-03-20' + interval (@rn := @rn + 1) day) as date
from t cross join
(select @rn := -1) params
) c
where c.date >= '2021-03-20' and c.date3 <= '2021-03-23';
You can really use any table for the c subquery -- so long as it has enough rows. If you know you want exactly four dates, you can hardcode those values:
select c.date,
(select count(*)
from t
where c.date between t.startdate and t.enddate
) as num_active
from (select date( '2021-03-20' ) as date union all
select date( '2021-03-21' ) as date union all
select date( '2021-03-22' ) as date union all
select date( '2021-03-23' ) as date
) c
where c.date >= '2021-03-20' and c.date3 <= '2021-03-23';