@nirgrahamuk pointed me in the right direction on Function factories.
The base R force function can be used within a function definition in a similar way to !! is used within the arguments of purrr::partial (See question where I force evaluation of nx in x_func).
nx <- 20
fun <- function(nx){
force(nx)
function(theta){rnorm(nx, theta[1], theta[2])}
}
fun2 <- fun(nx)
The function fun2 is now self-contained with regards to nx and its argument is in the right format. You can test this out with the following code
library(parallel)
cl <- makeCluster(3)
theta <- replicate(10, c(0,1), simplify = FALSE)
parLapply(cl, X = theta, fun2)