Yes, you can play with multiple people locally and with others online all at once. The total number of players is always 4.
To do this, once you are in an online lobby, have the other local player join like they would join a local game, by connecting a controller and pressing the button to join.
If you want anyone to be able to join your online lobby, make it Public and it will appear in the list of lobbies. If you only want friends to be able to join you online, make the lobby Private and share the lobby code with them. Make sure they are on a platform that can cross-play with yours.