Perfectly fine to use a Bahtinov Mask in front of the lens hood. That is how I've always used mine, and it makes them easier to remove without disturbing anything.
The size of the gaps in the grating does matter. The shorter the focal length, the finer the ideal grating should be. At some point (around 50mm f.l. or so), it becomes impractically fine, and the only semi-effective Bahtinov masks are laser-etched on to glass or acrylic. For 135mm-300mm focal length lenses, I have 3D-printed masks that fit over the lens hoods. Printing in PLA doesn't work well with the grating so fine, I have used Vinyl. I should say, if you don't have ideal spacing (gaps are too large) the Bahtinov mask will still sort of work, just not as effectively. The pattern may only show up on the brightest of stars, and the lines in the pattern will be thicker making it harder to judge when the line is centered in the X pattern.
Additional notes on 3D printing them if interested:
-This is a nice generator for getting the pattern:
https://satakagi.github.io/tribahtinovWebApps/Bahtinov.html-From there you can take the SVG into a 3D app to make a collar that fits around your lens hood. I have used the free web application TinkerCad for this:
https://www.tinkercad.com/and made a video (needs an update) a few years back:
https://youtu.be/a0Qk5jzsZfc