From the LRM, the 2nd argument allows a 'scope_or_assertion' which is a 'hierarchical_identifier'. So I believe that passing a module hierarchy to the 2nd argument should be allowed here. The original code is attempting to disable all assertions recursively within a module-hierarchy.
slangtest155.sv:18:23: error: expected scope or assertion name
$assertoff(0, m);
^
From the LRM, the 2nd argument allows a 'scope_or_assertion' which is a 'hierarchical_identifier'. So I believe that passing a module hierarchy to the 2nd argument should be allowed here. The original code is attempting to disable all assertions recursively within a module-hierarchy.