The error message points specifically to the 0 in select 0 from dual
; why it points to that specifically is not clear, since 0 itself is a constant (and therefore it is always a GROUP BY expression, no matter what else is happening). It is more likely that Gordon Linoff is right: the scalar subquery itself is the issue, since Oracle doesn't evaluate it "now" (at compilation time), it just says "I can't assume it will turn out to be a constant". In which case the error message should point to the beginning of the subquery, not to the 0 in it. Oh well...
Anyway: if you want to rewrite it in an equivalent way, that will be valid from the outset, you could do something like this:
select case when exists (select * from dual) then [the first thing]
else [the other thing] end ....
Replace your count(1) = 0
with an exists
condition - the difference is that there's no aggregation involved.