A unified framework of realistic in silico data generation and statistical model inference for single-cell and spatial omics