If you return to the US before your F-1 OPT EAD expires, it should definitely be ok. If you're trying to return after your EAD expires but with your new EAD pending, here's what it says on this F-1 travel FAQ from Homeland Security:
Can I re-enter if my request for OPT is pending?
Yes, but traveling during this time should be undertaken with caution. USCIS may send you a request for evidence while you are away, however, so you would want to make sure you have provided a correct U.S. address both to your DSO and on the application and would be able to send in requested documents. Also, if USCIS approves your OPT application, you will be expected to have your EAD in hand to re-enter the United States. Like a request for further information, USCIS can only send the EAD to your U.S. address.
Before traveling during OPT, it's always a good idea to check with your Designated School Official to make sure your I-20, SEVIS record, and OPT reporting requirements are all in order. In general it will help to bring a recently printed I-20 with travel signature, showing the most current OPT status (approved/pending). It may also help to bring proof of your OPT employment.
Note: You should also discuss your travel plans with your company's attorneys that filed your H-1B before you leave the US (better: before you buy your tickets) as travel can cause problems at certain points of the H-1B process. At the border, the consular H-1B application may make the officers more confused about your intentions, since you don't have an H-1B visa yet, so it's not valid for entry. Don't lie if asked about it, but be aware it won't help you enter the US without a matching visa. As you probably know, once your H-1B status begins, your OPT will end.