No. They are physically different mounts, with different dimensions, shapes, and sizes. EF-S lens on the left; EF-M lens on the right.
If the lens fits the EF-M mount, it will not fit the EF-S one without some type of physical linkage adapting. But even if there were such an adapter, you would never achieve the full range of focus to infinity with one, because the depth of the mounts is also different.
EF/EF-S mount is 44mm deep; EF-M is 18mm; RF/RF-S is 20mm. So, any mirrorless Canon lens would be sitting 26 or 28mm farther away from the sensor than it's designed to sit. This would be like using a macro extension tube, and would restrict the ability of the lens to focus at the far end. And that distance is probably far too large to be made up for with a teleconverter element in any adapter.
See also: Can I use lens brand X on interchangeable lens camera brand Y?