I would use the ALL keyword, e.g.
select *
from events
where now() > all (select event_date from events_dates where fk_event_id = event_id)
Supposing event_id is a parameter of your function.
I could not fathom what the checkIfAllDatesArePassed was supposed to be however.
Update from the comments:
drop function if exists checkIfAllDatesArePassed;
delimiter $$
create function checkIfAllDatesArePassed(event_id integer)
returns integer
language sql
begin
return select case
when now() > all (select event_date from events_dates where fk_event_id = event_id) then 1
else 0;
end;
$$
delimiter;
Would that do?