Hi Pawan
Filters should technically be mounted in the light path where the light rays are parallel, which, in a telescope would be either at the objective or after the eyepiece. The objective is impractical of course, but I think we don’t mount it at the output of the eyepiece because it can make a mess with our eyes and the eye relief.
The compromise in amateur astronomy is to simply thread the filter close to the focus. This has the problem of different light rays that form the image having a different angles will see a different passband for the filter, especially more severe in fast telescopes. The other problem of placing the filters on the focus is that you will see the dust on the filter. So in fact, the filters should be placed as far from focus as possible
However, there is one more caveat. We use 2" filters at largest. The wide field eyepieces that have 2" barrels can start having vignetting if there is more than 2" of obstruction at the rear end of their barrels depending on how they're designed. This means we do want to place the filters as close to the back of your focuser barrel as possible, because otherwise you may introduce vignetting from the filter blocking some of the rays.
Therefore, most Dobsonian users have a filter slide mounted right behind the focuser barrel. Here is a good example:
https://astrocrumb.com/
Regards
Akarsh
PS: Part of the reason I wrote out all of this is to check my understanding, if someone thinks something I said is wrong I'd love to learn