Yes and no. Slimes come in 3 sizes, ranging from 1x1 sized to 2x2 and 3x3 size (technically they're a little bit smaller than this). If there's room for the slimes to spawn, they will spawn. Except for witch huts and guardian temples (and I guess the new pillager outposts?), minecraft doesn't care what your farm is designed for...it will spawn everything that fits there.