B2 to H1 conversion while in USA

Me,My wife and son all have valid b2 visa. We came to usa in May 2018 on vacation.

I have cap exempt H1 approved from oct 2022.

Can we travel to USA on tourist visa? And then convert to H1 and h4 respectively?

Yes you can, ideally with the right intention that is inline with the visa class you enter on.

Talk to your immigration lawyer before attempting to do this. Technically once in the US on B2, your employer may be able to file H1B amendment in premium processing with change of status from B2 to H1B before 1st October.