I'll question "It is possible to create a Volume inside a file....", though. Didn't you mean "folder"?
No I mean file. When an image file "mounts" it is assigned a "mount point" in the system and has its own volume and directory structure. A folder on the other hand is dependent on the volume and file structure of the volume it is on. (In APFS you would not be too far off the mark to think of the drive volume as an image file, but that is a different can of worms I am still trying to get my head around and would rather not open here.)