It's not possible to do it the way you describe. Sector size is a block device property which files don't inherently have. A file is just a sequence of a certain number of bytes, how those are stored is an implementation detail...
So if you want a specific sector size, you need a block device. And Linux offers loop devices just for this purpose, so use losetup
to create a file-backed virtual block device with a certain sector size.
Test file:
# dd if=/dev/zero of=empty4k.img bs=4096 count=8192
Regular loop device:
# losetup --find --show empty4k.img
/dev/loop0
# fdisk -l /dev/loop0
Disk /dev/loop0: 32 MiB, 33554432 bytes, 65536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
4096-byte sectors loop device:
# losetup --find --show --sector-size=4096 empty4k.img
/dev/loop1
# fdisk -l /dev/loop1
Disk /dev/loop1: 32 MiB, 33554432 bytes, 8192 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
In both cases, the file is completely identical, sector size property is provided by the block loop device layer.
dd
doesn't really care about sectors, and there is no sector information in an IMG file. Sectors are a hardware thing these days. The sector size would only change how you compute a file offset from a sector index...