Does flashing the stock ROM repartition the device internal memory? After I have repartitioned my tablet I wonder what would happen if I flashed the stock ROM again.
A full firmware from the manufacturer can do that. You can see the flash sequence has a file similar to gpt_both or anything with GPT in the filename and is flashed to the partition partition. For example: fastboot flash partition gpt_both.bin

If there's no such file you can find, then the flash sequence is most likely not rebuilding the partition structure.