Spread olive oil with a pastry or basting brush over two slices of bread. Sprinkle each with salt and pepper.
Place one of the bread slices, oil-side down and top basil leaves, tomato slices, onion, and mozzarella. Top with other piece of bread, olive oil side up.
Place a heavy-bottomed skillet on the stovetop over medium-high heat or use a Panini press.
If using a skillet, press down with lid to flatten the sandwich a bit. Cook for about 2 minutes, until golden on the bottom, and flip. Repeat on other side.