Can ailerons be used to control yaw and pitch
Depending on the geometry of the vehicle, up to a degree yes. However, with a classic aileron setup and no rudder, it might be impossible to control roll and yaw independently. A split flap (up and down on same wing) would be required to more effectively control yaw, as that can in theory generate drag on one side without much affecting lift. The B2 bomber sports a similar configuration.