I'm running virtualbox on windows 10 with an i5-9300H, which is 4 cores and 8 threads. On virtual box setup, the its only recommending 4 CPUs though it allows up to 8. I believe the virtual cpus are simulated, although my question is, if increase the number of CPUs to 6, will it affect performance of host or guest? I'm running lubuntu 20.10 as guest for doing Linux From Scratch project, so to compile the kernel, I believe more cores the better(please correct me if I'm wrong).
No, in VirtualBox virtual CPUs are not simulated. CPU emulation is terribly inefficient, a modern OS would be unusable on an emulated CPU. Your CPU actually has built-in support for virtualization, ie. running code as if it wasn't a virtual machine, but in an environment controlled by host's code. So when you're setting how many cores are available to the VM, you're actually giving it access to real logical cores of your CPU.
VirtualBox is recommending assigning only 4 logical cores, because there are only 4 physical cores in your CPU. Assigning more logical cores than physical cores would supposedly offer worse performance than 4 cores only. Whether that's actually a case or not for your use case, you have to test yourself. The answer may depend on the architecture of your CPU, host's scheduler, guest's scheduler and possibly other factors.
Having more cores is usually better than having less identical cores, unless this leads to the scheduling machinery working sub-optimally (for example if it makes wrong assumptions about what's optimal for that CPU configuration). There are known cases where disabling SMT (splitting physical cores into multiple logical cores) may improve performance.